From d06802778e28a4772292ac36a2f83064dacefc21 Mon Sep 17 00:00:00 2001 From: Huy Do Date: Wed, 24 May 2023 07:45:43 +0000 Subject: [PATCH] No need to run C++ tests under rerun disabled tests mode (#102132) Per title. I extract this part out of the draft PR that I'm working on https://github.com/pytorch/pytorch/pull/102107 because the remaining issues with rerun disabled tests: log size and unexpected runner failures requires some further investigations while this one is clearing breaking in trunk atm. Until we can support disable C++ tests, there is no need to run them in rerun disabled tests mode. ### Testing Coming from https://github.com/pytorch/pytorch/pull/102107, for example https://github.com/pytorch/pytorch/actions/runs/5062224659/jobs/9087747981 ``` 2023-05-23T22:46:50.1953318Z Running cpp/basic 1/1 ... [2023-05-23 22:46:50.195077] 2023-05-23T22:46:50.1953847Z Skipping C++ tests when running under RERUN_DISABLED_TESTS mode 2023-05-23T22:46:50.2066032Z Running cpp/atest 1/1 ... [2023-05-23 22:46:50.206348] 2023-05-23T22:46:50.2066435Z Skipping C++ tests when running under RERUN_DISABLED_TESTS mode 2023-05-23T22:46:52.2666743Z No CUDA runtime is found, using CUDA_HOME='/usr/local/cuda' 2023-05-23T22:46:52.2691817Z Ignoring disabled issues: [] ... ``` Pull Request resolved: https://github.com/pytorch/pytorch/pull/102132 Approved by: https://github.com/clee2000 --- test/run_test.py | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/test/run_test.py b/test/run_test.py index a2bab060219..fb0a98f2922 100755 --- a/test/run_test.py +++ b/test/run_test.py @@ -492,6 +492,15 @@ def run_test( use_sharded_test = True is_cpp_test = test_file.startswith(CPP_TEST_PREFIX) + # NB: Rerun disabled tests depends on pytest-flakefinder and it doesn't work with + # pytest-cpp atm. We also don't have support to disable C++ test yet, so it's ok + # to just return successfully here + if is_cpp_test and RERUN_DISABLED_TESTS: + print_to_stderr( + "Skipping C++ tests when running under RERUN_DISABLED_TESTS mode" + ) + return 0 + if use_sharded_test: if is_cpp_test: stepcurrent_key = test_file