From cc0b23fc323c7854c2b42100a4bd3cbba5798f8d Mon Sep 17 00:00:00 2001 From: Sjors Provoost Date: Fri, 3 Apr 2026 22:04:26 +0200 Subject: [PATCH] test: increase spawn test child timeout to 30 seconds MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Example CI failure: 3/157 Test #3: mptest ...............................***Failed 1.06 sec [ TEST ] spawn_tests.cpp:44: SpawnProcess does not run callback in child ./ipc/libmultiprocess/test/mp/test/spawn_tests.cpp:108: failed: expected exited; Timeout waiting for child process to exit stack: bf2ed1 cc4091 cc4545 d817f9 d82ba3 bf220b ee33f4b9 ee33f555 ./ipc/libmultiprocess/test/mp/test/spawn_tests.cpp:109: failed: expected WIFEXITED(status) && WEXITSTATUS(status) == 0 stack: bf2e03 cc4091 cc4545 d817f9 d82ba3 bf220b ee33f4b9 ee33f555 [ FAIL ] spawn_tests.cpp:44: SpawnProcess does not run callback in child (1051610 μs) [ TEST ] test.cpp:124: Call FooInterface methods [ PASS ] test.cpp:124: Call FooInterface methods (3744 μs) [ TEST ] test.cpp:216: Call IPC method after client connection is closed [ PASS ] test.cpp:216: Call IPC method after client connection is closed (363 μs) [ TEST ] test.cpp:233: Calling IPC method after server connection is closed [ PASS ] test.cpp:233: Calling IPC method after server connection is closed (346 μs) [ TEST ] test.cpp:250: Calling IPC method and disconnecting during the call [ PASS ] test.cpp:250: Calling IPC method and disconnecting during the call (354 μs) [ TEST ] test.cpp:270: Calling IPC method, disconnecting and blocking during the call [ PASS ] test.cpp:270: Calling IPC method, disconnecting and blocking during the call (554 μs) [ TEST ] test.cpp:319: Make simultaneous IPC calls on single remote thread [ PASS ] test.cpp:319: Make simultaneous IPC calls on single remote thread (741 μs) 6 test(s) passed 1 test(s) failed Fixes bitcoin/bitcoin#34975 --- test/mp/test/spawn_tests.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/test/mp/test/spawn_tests.cpp b/test/mp/test/spawn_tests.cpp index 4c7edba4..a14e50e2 100644 --- a/test/mp/test/spawn_tests.cpp +++ b/test/mp/test/spawn_tests.cpp @@ -20,6 +20,8 @@ namespace { +constexpr auto FAILURE_TIMEOUT = std::chrono::seconds{30}; + // Poll for child process exit using waitpid(..., WNOHANG) until the child exits // or timeout expires. Returns true if the child exited and status_out was set. // Returns false on timeout or error. @@ -94,9 +96,9 @@ KJ_TEST("SpawnProcess does not run callback in child") ::close(fd); int status{0}; - // Give the child up to 1 second to exit. If it does not, terminate it and + // Give the child some time to exit. If it does not, terminate it and // reap it to avoid leaving a zombie behind. - const bool exited{WaitPidWithTimeout(pid, std::chrono::milliseconds{1000}, status)}; + const bool exited{WaitPidWithTimeout(pid, FAILURE_TIMEOUT, status)}; if (!exited) { ::kill(pid, SIGKILL); ::waitpid(pid, &status, /*options=*/0);