Skip to content

Commit

Permalink
Change how we 'touch' a file when testing dep files
Browse files Browse the repository at this point in the history
Summary: This allows us to "touch" a file more than once.

Reviewed By: scottcao

Differential Revision: D63318013

fbshipit-source-id: 9355d29d052b00a8022124308cdb06c83d043245
  • Loading branch information
Ian Childs authored and facebook-github-bot committed Sep 30, 2024
1 parent fe19aa4 commit abb4a56
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions tests/e2e/build/test_dep_files.py
Original file line number Diff line number Diff line change
Expand Up @@ -92,13 +92,13 @@ async def _get_execution_kind(buck: Buck) -> int:

def touch(buck: Buck, name: str) -> None:
"""
Modify the marker in one of our files
Append a random string to the marker in the file
"""
with open(buck.cwd / name, "r", encoding="utf-8") as f:
text = f.read()

with open(buck.cwd / name, "w", encoding="utf-8") as f:
f.write(text.replace("__MARKER__", random_string()))
f.write(text.replace("__MARKER__", "__MARKER__{}".format(random_string())))


# Flaky because of watchman on mac (and maybe windows)
Expand Down

0 comments on commit abb4a56

Please sign in to comment.