Failing gitlab CI examples are: - [job #157583](https://gitlab.winehq.org/wine/wine/-/jobs/157583#L2282) - [job #157314](https://gitlab.winehq.org/wine/wine/-/jobs/157314#L1957) - [job #157131](https://gitlab.winehq.org/wine/wine/-/jobs/157131#L2052) - [job #157068](https://gitlab.winehq.org/wine/wine/-/jobs/157068#L1955) - [job #157032](https://gitlab.winehq.org/wine/wine/-/jobs/157032#L2150) - [job #156785](https://gitlab.winehq.org/wine/wine/-/jobs/156785#L2112) - [job #156713](https://gitlab.winehq.org/wine/wine/-/jobs/156713#L2048) - [job 156677#](https://gitlab.winehq.org/wine/wine/-/jobs/156677#L2030)
So happens just a few times per day.
The value -1073741510 in `timeout.exe:timeout:06b4 done (-1073741510) in 5s 177B` equals to 0xC000013A, STATUS_CONTROL_C_EXIT. Therefore the assumption the ctrl-c from the test reaches sometimes the parent process.
-- v6: timeout/tests: Move the ctrl-c tests below an intermediate process.
From: Bernhard Übelacker bernhardu@mailbox.org
This is an attempt to avoid some flaky test failures where the parent test process returns a STATUS_CONTROL_C_EXIT exit code. --- programs/timeout/tests/timeout.c | 42 ++++++++++++++++++++++++++++---- 1 file changed, 37 insertions(+), 5 deletions(-)
diff --git a/programs/timeout/tests/timeout.c b/programs/timeout/tests/timeout.c index bd99eb9e5e1..2ac4131b211 100644 --- a/programs/timeout/tests/timeout.c +++ b/programs/timeout/tests/timeout.c @@ -125,20 +125,51 @@ static void _run_timeout_ctrlc(const char *file, int line, const char *option, D CloseHandle(process_info.hProcess); CloseHandle(process_info.hThread);
- flaky_wine_if(exitcode_expected == STATUS_CONTROL_C_EXIT) ok_(file, line)(exitcode == exitcode_expected, "Expected exitcode %ld, got %lx\n", exitcode_expected, exitcode); }
-static void test_ctrlc(void) +static void test_ctrlc(int argc, char** argv) { - run_timeout_ctrlc("", STATUS_CONTROL_C_EXIT); - run_timeout_ctrlc("/nobreak", 1); + if (!strcmp(argv[3], "normal")) + run_timeout_ctrlc("", STATUS_CONTROL_C_EXIT); + else if (!strcmp(argv[3], "nobreak")) + run_timeout_ctrlc("/nobreak", 1); + else + ok(0, "Unknown test %s.\n", argv[3]); +} + +static void test_ctrlc_intermediate(int argc, char** argv, const char* name) +{ + char path_name[MAX_PATH]; + STARTUPINFOA startup; + PROCESS_INFORMATION info; + + memset(&startup, 0, sizeof(startup)); + startup.cb = sizeof(startup); + sprintf(path_name, "%s %s %s %s", argv[0], argv[1], "ctrlc_intermediate", name); + ok(CreateProcessA(NULL, path_name, NULL, NULL, FALSE, + CREATE_NEW_PROCESS_GROUP | CREATE_NEW_CONSOLE, + NULL, NULL, &startup, &info), + "CreateProcess failed.\n"); + wait_child_process(info.hProcess); + CloseHandle(info.hProcess); + CloseHandle(info.hThread); }
START_TEST(timeout) { + int argc; + char** argv; BOOL ret; + + argc = winetest_get_mainargs(&argv); + if(argc == 4 && !strcmp(argv[2], "ctrlc_intermediate")) + { + test_ctrlc(argc, argv); + return; + } + /* always run on a separate console, so that: * - we're sure to have a valid console input handle (no Wine unix console...) * - we can send ctrl-c events without interfering with parent (winetest...) @@ -158,5 +189,6 @@ START_TEST(timeout) }
test_basic(); - test_ctrlc(); + test_ctrlc_intermediate(argc, argv, "normal"); + test_ctrlc_intermediate(argc, argv, "nobreak"); }
On Fri May 16 07:10:20 2025 +0000, eric pouech wrote:
LGTM I would favor also removing the flaky_wine_if line.
Thanks, done in v6.