From 953fb19aaec7c1f98058c0a41227bd2de6a4883d Mon Sep 17 00:00:00 2001 From: Sam Clegg Date: Wed, 18 Sep 2019 20:13:53 -0700 Subject: [PATCH 1/2] Skip sanity checked in sub-processes See #5042 and #6124 --- tests/test_sanity.py | 3 +++ tools/shared.py | 7 +++++-- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/tests/test_sanity.py b/tests/test_sanity.py index 58a8004f11106..0db37f1d10004 100644 --- a/tests/test_sanity.py +++ b/tests/test_sanity.py @@ -106,6 +106,9 @@ class sanity(RunnerCore): @classmethod def setUpClass(cls): super(sanity, cls).setUpClass() + # Unlike the other test suites we explicitly don't want to be skipping + # the sanity checks here + del os.environ['EMCC_SKIP_SANITY_CHECK'] shutil.copyfile(CONFIG_FILE, CONFIG_FILE + '_backup') print() diff --git a/tools/shared.py b/tools/shared.py index 98c5525564098..ea1a27ee0de8e 100644 --- a/tools/shared.py +++ b/tools/shared.py @@ -543,11 +543,14 @@ def check_sanity(force=False): EM_CONFIG (so, we re-check sanity when the settings are changed). We also re-check sanity and clear the cache when the version changes. """ + if os.environ.get('EMCC_SKIP_SANITY_CHECK') == '1': + return + # We set EMCC_SKIP_SANITY_CHECK so that any subprocesses that we launch will + # not re-run the tests. + os.environ['EMCC_SKIP_SANITY_CHECK'] = '1' with ToolchainProfiler.profile_block('sanity'): check_llvm_version() expected = generate_sanity() - if os.environ.get('EMCC_SKIP_SANITY_CHECK') == '1': - return reason = None if not CONFIG_FILE: return # config stored directly in EM_CONFIG => skip sanity checks From b52ca253b1252ae44f41b221b07697beb5469098 Mon Sep 17 00:00:00 2001 From: Sam Clegg Date: Wed, 18 Sep 2019 21:42:53 -0700 Subject: [PATCH 2/2] fix tests --- tools/shared.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/shared.py b/tools/shared.py index ea1a27ee0de8e..17262316068d0 100644 --- a/tools/shared.py +++ b/tools/shared.py @@ -543,7 +543,7 @@ def check_sanity(force=False): EM_CONFIG (so, we re-check sanity when the settings are changed). We also re-check sanity and clear the cache when the version changes. """ - if os.environ.get('EMCC_SKIP_SANITY_CHECK') == '1': + if not force and os.environ.get('EMCC_SKIP_SANITY_CHECK') == '1': return # We set EMCC_SKIP_SANITY_CHECK so that any subprocesses that we launch will # not re-run the tests.