Skip to content

Commit 189fa17

Browse files
committed
test: increase spawn test child timeout to 30 seconds
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
1 parent 70f632b commit 189fa17

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

test/mp/test/spawn_tests.cpp

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,8 @@
2020

2121
namespace {
2222

23+
constexpr auto FAILURE_TIMEOUT = std::chrono::seconds{30};
24+
2325
// Poll for child process exit using waitpid(..., WNOHANG) until the child exits
2426
// or timeout expires. Returns true if the child exited and status_out was set.
2527
// Returns false on timeout or error.
@@ -94,9 +96,9 @@ KJ_TEST("SpawnProcess does not run callback in child")
9496
::close(fd);
9597

9698
int status{0};
97-
// Give the child up to 1 second to exit. If it does not, terminate it and
99+
// Give the child some time to exit. If it does not, terminate it and
98100
// reap it to avoid leaving a zombie behind.
99-
const bool exited{WaitPidWithTimeout(pid, std::chrono::milliseconds{1000}, status)};
101+
const bool exited{WaitPidWithTimeout(pid, FAILURE_TIMEOUT, status)};
100102
if (!exited) {
101103
::kill(pid, SIGKILL);
102104
::waitpid(pid, &status, /*options=*/0);

0 commit comments

Comments
 (0)