Skip to content

Commit 979e16a

Browse files
authored
Adding slang-test option to ignore abort popup message (#8492)
With the recent Windows runtime libraries, a new popup window started appearing when `abort()` is called. This was observed when VVL prints a message as a part of WGPU test. Although it can be helpful when we want to debug it, it breaks the behavior of CI scripts when the tests are expected to continue even when they fail. When the test fail, CI script stops in the middle and wait for a user to click on a button on the dialog window, which cannot happen. As a result, when there is a VVL error message, CI run stops in the middle and the testing stops prematurely. This commit adds a new command-line argument, `-ignore-abort-msg`, that ignores the abort message and it wouldn't show the dialog popup window. From the implementation perspective, there are three places that are related. - slang-test itself should turn off the flag. - render-test should turn off the flag after getting the argument from slang-test - test-server should turn off the flag after getting the argument from slang-test When test-server runs render-test, the arguments are already handled by slang-test, so test-server needs to just pass through the arguments.
1 parent 796ea80 commit 979e16a

File tree

7 files changed

+49
-2
lines changed

7 files changed

+49
-2
lines changed

.github/workflows/ci-slang-test.yml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,7 @@ jobs:
6666
"-expected-failure-list" "tests/expected-failure-github.txt"
6767
"-skip-reference-image-generation"
6868
"-show-adapter-info"
69+
"-ignore-abort-msg"
6970
"-enable-debug-layers" "${{ inputs.enable-debug-layers }}"
7071
)
7172
@@ -106,10 +107,10 @@ jobs:
106107
-server-count ${{ inputs.server-count }} \
107108
-category ${{ inputs.test-category }} \
108109
-emit-spirv-via-glsl \
110+
-ignore-abort-msg \
109111
-api vk \
110112
-expected-failure-list tests/expected-failure-via-glsl.txt \
111-
-skip-reference-image-generation \
112-
-show-adapter-info
113+
-skip-reference-image-generation
113114
114115
# Run slang-rhi tests when:
115116
# 1. full-gpu-tests is enabled AND

tools/render-test/options.cpp

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -278,6 +278,12 @@ static rhi::DeviceType _toRenderType(Slang::RenderApiType apiType)
278278
{
279279
outOptions.showAdapterInfo = true;
280280
}
281+
else if (argValue == "-ignore-abort-msg")
282+
{
283+
#ifdef _MSC_VER
284+
_set_abort_behavior(0, _WRITE_ABORT_MSG);
285+
#endif
286+
}
281287
else if (argValue == "-cache-rhi-device")
282288
{
283289
outOptions.cacheRhiDevice = true;

tools/slang-test/options.cpp

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,13 @@ static bool _isSubCommand(const char* arg)
9090
" -use-test-server Run tests using test server\n"
9191
" -use-fully-isolated-test-server Run each test in isolated server\n"
9292
" -capability <name> Compile with the given capability\n"
93+
94+
// Recent Windows runtime versions started opening a dialog popup window when
95+
// `abort()` is called, which breaks the CI workflow and some scripts that
96+
// expect a normal termination.
97+
// It can be helpful for debugging but we should ignore it for CI.
98+
" -ignore-abort-msg Ignore abort message dialog popup on Windows\n"
99+
93100
" -enable-debug-layers [true|false] Enable or disable Validation Layer for Vulkan\n"
94101
" and Debug Device for DX\n"
95102
" -cache-rhi-device [true|false] Enable or disable RHI device caching (default: true)\n"
@@ -433,6 +440,13 @@ static bool _isSubCommand(const char* arg)
433440
}
434441
optionsOut->capabilities.add(*argCursor++);
435442
}
443+
else if (strcmp(arg, "-ignore-abort-msg") == 0)
444+
{
445+
optionsOut->ignoreAbortMsg = true;
446+
#ifdef _MSC_VER
447+
_set_abort_behavior(0, _WRITE_ABORT_MSG);
448+
#endif
449+
}
436450
else if (strcmp(arg, "-expected-failure-list") == 0)
437451
{
438452
if (argCursor == argEnd)

tools/slang-test/options.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -142,6 +142,9 @@ struct Options
142142
Slang::HashSet<Slang::String> capabilities;
143143
Slang::HashSet<Slang::String> expectedFailureList;
144144

145+
// Ignore abort message dialog popup on Windows
146+
bool ignoreAbortMsg = false;
147+
145148
/// Parse the args, report any errors into stdError, and write the results into optionsOut
146149
static SlangResult parse(
147150
int argc,

tools/slang-test/slang-test-main.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3644,6 +3644,11 @@ static void _addRenderTestOptions(const Options& options, CommandLine& ioCmdLine
36443644
ioCmdLine.addArg("-enable-debug-layers");
36453645
}
36463646

3647+
if (options.ignoreAbortMsg)
3648+
{
3649+
ioCmdLine.addArg("-ignore-abort-msg");
3650+
}
3651+
36473652
if (options.cacheRhiDevice)
36483653
{
36493654
ioCmdLine.addArg("-cache-rhi-device");

tools/slang-test/test-context.cpp

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -196,6 +196,12 @@ SlangResult TestContext::_createJSONRPCConnection(RefPtr<JSONRPCConnection>& out
196196
{
197197
CommandLine cmdLine;
198198
cmdLine.setExecutableLocation(ExecutableLocation(exeDirectoryPath, "test-server"));
199+
200+
if (options.ignoreAbortMsg)
201+
{
202+
cmdLine.addArg("-ignore-abort-msg");
203+
}
204+
199205
SLANG_RETURN_ON_FAIL(Process::create(
200206
cmdLine,
201207
Process::Flag::AttachDebugger | Process::Flag::DisableStdErrRedirection,

tools/test-server/test-server-main.cpp

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -191,6 +191,18 @@ SlangResult TestServer::init(int argc, const char* const* argv)
191191
{
192192
m_exePath = argv[0];
193193

194+
// Command-line argument parsing
195+
for (int i = 1; i < argc; i++)
196+
{
197+
if (strcmp(argv[i], "-ignore-abort-msg") == 0)
198+
{
199+
#ifdef _MSC_VER
200+
_set_abort_behavior(0, _WRITE_ABORT_MSG);
201+
#endif
202+
}
203+
// Ignore unknown arguments for now
204+
}
205+
194206
String canonicalPath;
195207
if (SLANG_SUCCEEDED(Path::getCanonical(m_exePath, canonicalPath)))
196208
{

0 commit comments

Comments
 (0)