From 34df838c04e57e45b2dc8b208c9636e3923b2e77 Mon Sep 17 00:00:00 2001 From: Jukka Lehtosalo Date: Fri, 2 Sep 2022 12:11:23 +0100 Subject: [PATCH 1/2] Attempt to work around mypyc test failures in CI --- mypyc/test/test_run.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/mypyc/test/test_run.py b/mypyc/test/test_run.py index 9625f59dd3070..5a750441d4432 100644 --- a/mypyc/test/test_run.py +++ b/mypyc/test/test_run.py @@ -10,6 +10,7 @@ import shutil import subprocess import sys +import time from typing import Any, Iterator, cast from mypy import build @@ -169,6 +170,12 @@ 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 GitHub actions, changing the mtime isn't effective on + # Linux. As a workaround, sleep. + # + # TODO: Figure out a better approach, since this slows down tests. + if sys.platform == "linux" and "GITHUB_ACTION" in os.environ: + time.sleep(1.0) step += 1 with chdir_manager(".."): From 6332f756a955db19c7b0336e91b92cae4e99f056 Mon Sep 17 00:00:00 2001 From: Jukka Lehtosalo Date: Fri, 2 Sep 2022 13:03:45 +0100 Subject: [PATCH 2/2] Use the workaround always on Linux --- mypyc/test/test_run.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/mypyc/test/test_run.py b/mypyc/test/test_run.py index 5a750441d4432..0cca1890653e7 100644 --- a/mypyc/test/test_run.py +++ b/mypyc/test/test_run.py @@ -170,11 +170,11 @@ 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 GitHub actions, changing the mtime isn't effective on - # Linux. As a workaround, sleep. + # On Ubuntu, 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" and "GITHUB_ACTION" in os.environ: + if sys.platform == "linux": time.sleep(1.0) step += 1