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);