Skip to content

Commit

Permalink
An attempt to fix mypyc tests on MacOS (#16520)
Browse files Browse the repository at this point in the history
Fixes #16420

Although this is not 100% clear yet, but after 20 runs on a Mac I have
it no longer fails (without this patch it failed 20% of times). Btw,
contrary to the comment, _my_ Linux Mint (which is an Ubuntu derivative)
works perfectly (i.e. test passed 20 times even after I removed the
`sleep()`). So it is not really Mac vs Linux issue.
  • Loading branch information
ilevkivskyi committed Nov 19, 2023
1 parent 706389d commit a3e488d
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions mypyc/test/test_run.py
Original file line number Diff line number Diff line change
Expand Up @@ -172,12 +172,10 @@ def run_case_inner(self, testcase: DataDrivenTestCase) -> None:
# new by distutils, shift the mtime of all of the
# generated artifacts back by a second.
fudge_dir_mtimes(WORKDIR, -1)
# On Ubuntu, changing the mtime doesn't work reliably. As
# On some OS, changing the mtime doesn't work reliably. As
# a workaround, sleep.
#
# TODO: Figure out a better approach, since this slows down tests.
if sys.platform == "linux":
time.sleep(1.0)
time.sleep(1.0)

step += 1
with chdir_manager(".."):
Expand Down

0 comments on commit a3e488d

Please sign in to comment.