diff options
| author | Gangzheng Tong <tonggangzheng@gmail.com> | 2025-05-20 16:01:59 -0700 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2025-05-20 16:01:59 -0700 |
| commit | 52d70f37f66d8fc34bc142386490bdcde0fc7db0 (patch) | |
| tree | e95d679dad312862362b2afd2f2559d496bbad26 /tools | |
| parent | ccb1dd5ffb8edb0086230fdcf5e16936c2bfd37f (diff) | |
Fix retry logic and skip high intermittent test failure (#7175)
* skip recordReplay; fix retrying logic for unit test
* Allow the CI to run with manual dispatch
* increase failed test limit to 100
* reduce the serve count to 2
Diffstat (limited to 'tools')
| -rw-r--r-- | tools/slang-test/slang-test-main.cpp | 16 |
1 files changed, 12 insertions, 4 deletions
diff --git a/tools/slang-test/slang-test-main.cpp b/tools/slang-test/slang-test-main.cpp index 02d305a46..0d7540357 100644 --- a/tools/slang-test/slang-test-main.cpp +++ b/tools/slang-test/slang-test-main.cpp @@ -4598,7 +4598,7 @@ void runTestsInDirectory(TestContext* context) { if (shouldRunTest(context, file)) { - // fprintf(stderr, "slang-test: found '%s'\n", file.getBuffer()); + printf("found test: '%s'\n", file.getBuffer()); if (SLANG_FAILED(_runTestsOnFile(context, file))) { { @@ -4766,15 +4766,23 @@ static SlangResult runUnitTestModule( bool isFailed = (SLANG_FAILED(rpcRes) || testResult == TestResult::Fail); + // If the rpc failed, output an error message + if (SLANG_FAILED(rpcRes)) + { + reporter->message(TestMessageType::RunError, "rpc failed"); + } + // If the test fails, output any output - which might give information about // individual tests that have failed. - if (isFailed) + if (testResult == TestResult::Fail) { String output = getOutput(exeRes); reporter->message(TestMessageType::TestFailure, output.getBuffer()); } - if (isFailed && !context->isRetry && + // If the test failed and it is not an expected failure, add it to the list of + // failed unit tests. + if (isFailed && !context->getTestReporter()->m_expectedFailureList.contains(test.testName)) { std::lock_guard lock(context->mutexFailedTests); @@ -5095,7 +5103,7 @@ SlangResult innerMain(int argc, char** argv) // excution or driver instability. We can try running them again. Debug build has more // instability at this moment, so we allow more retries. #if _DEBUG - static constexpr int kFailedTestLimitForRetry = 32; + static constexpr int kFailedTestLimitForRetry = 100; #else static constexpr int kFailedTestLimitForRetry = 16; #endif |
