Skip to content

test: increase spawn test child timeout to 30 seconds#266

Open
Sjors wants to merge 1 commit intobitcoin-core:masterfrom
Sjors:2026/04/spwan-test-timeout
Open

test: increase spawn test child timeout to 30 seconds#266
Sjors wants to merge 1 commit intobitcoin-core:masterfrom
Sjors:2026/04/spwan-test-timeout

Conversation

@Sjors
Copy link
Copy Markdown
Member

@Sjors Sjors commented Apr 1, 2026

Bump timeout from 1 second to 30 to prevent spurious timeouts.

Fixes bitcoin/bitcoin#34975

@DrahtBot
Copy link
Copy Markdown

DrahtBot commented Apr 1, 2026

The following sections might be updated with supplementary metadata relevant to reviewers and maintainers.

Reviews

See the guideline for information on the review process.
A summary of reviews will appear here.

Comment on lines +97 to +99
// Give the child up to 30 seconds 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, std::chrono::milliseconds{30000}, status)};
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
// Give the child up to 30 seconds 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, std::chrono::milliseconds{30000}, status)};
// 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::seconds{30}, status)};

nit: The chrono header can do the needed multiplication for you, no need to do it manually in the source code

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice, I'll let CI finish running and then push this.

Example CI failure:

  3/157 Test   bitcoin-core#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
@Sjors
Copy link
Copy Markdown
Member Author

Sjors commented Apr 1, 2026

No timeouts on the 3 jobs x 2 pushes worth of Bitcoin Core CI runs here. However, I don't remember seeing those here before anyway.

I also opened a subtree update PR bitcoin/bitcoin#34977 so that should give us another run.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

spawn_tests: failed: expected WIFEXITED(status) && WEXITSTATUS(status) == 0

3 participants