From 0382c5116208a944da0153c94d30e1c21ae4e49c Mon Sep 17 00:00:00 2001 From: Jay Kwak <82421531+jkwak-work@users.noreply.github.com> Date: Fri, 13 Jun 2025 00:39:29 -0700 Subject: Sort test list to be deterministic (#7432) On Linux/MacOS, the test file lists were not in a sorted order and the order was non-deterministic. It causes intermittent CI failures. This commit is to make the list sorted and CI more reliable. --- tools/slang-test/slang-test-main.cpp | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/tools/slang-test/slang-test-main.cpp b/tools/slang-test/slang-test-main.cpp index 742300d22..f03ae8292 100644 --- a/tools/slang-test/slang-test-main.cpp +++ b/tools/slang-test/slang-test-main.cpp @@ -4579,6 +4579,16 @@ void runTestsInDirectory(TestContext* context) { List files; getFilesInDirectory(context->options.testDir, files); + + // NTFS on Windows stores files in sorted order but not on Linux/Macos. + // Because of that, the testing on Linux/Macos were randomly failing, which + // is a good thing because it reveals problems. But it is useless + // if we cannot reproduce the failures deterministrically. + // https://github.com/shader-slang/slang/issues/7388 + // + // TODO: We need a way to shuffle the list in a deterministic manner. + files.sort(); + auto processFile = [&](String file) { if (shouldRunTest(context, file)) -- cgit v1.2.3