Skip to content

test(ci): RUN_SERIAL the fork()+IPC multiprocess tests to de-flake linux master - #121

Merged
transfix merged 1 commit into
masterfrom
fix/flaky-multiprocess-ipc-run-serial
Jul 21, 2026
Merged

transfix merged 1 commit into
masterfrom
fix/flaky-multiprocess-ipc-run-serial

Conversation

@transfix

Copy link
Copy Markdown
Owner

Problem

package-linux / libcvc-release intermittently goes red on push-to-master at the Run tests step, on:

[ FAILED ] StateExecMultiprocessIpc.StateTreeReplication (15073 ms)

Only ~1 in 5 recent master runs; PR checks pass (they also skip the heaviest suites and the flake usually clears within --repeat until-pass:3).

Root cause

state_exec_multiprocess_test fork()s two processes that replicate state over a Unix-domain socket, with internal deadlines (5s connect, 15s replicate). Under ctest --parallel on a loaded runner the forked children get CPU-starved and miss those windows → the test fails all three retries. It's load-induced flakiness, not a logic race — it passes reliably when uncontended.

Fix

Mark the two fork()+IPC suites — state_exec_multiprocess_test and state_multiprocess_ipc_test — RUN_SERIAL via gtest_discover_tests(... PROPERTIES RUN_SERIAL TRUE), so ctest never runs them concurrently with other tests. Test-scheduling only; no product-code or test-logic change.

StateExecMultiprocessIpc.StateTreeReplication intermittently fails on
push-to-master (linux-release 'Run tests'): it forks two processes that
replicate state over a Unix-domain socket within internal pump deadlines
(5s connect, 15s replicate). Under `ctest --parallel` on a loaded runner
the forked children are starved and miss those windows, so the test fails
all three `until-pass:3` retries — while passing on lighter PR runs (which
also skip the heaviest suites). It is load-induced flakiness, not a logic
race (it passes reliably when not contended).

Mark the two fork()+IPC suites (state_exec_multiprocess_test,
state_multiprocess_ipc_test) RUN_SERIAL so ctest never schedules them
alongside other tests, giving their timing windows the whole machine.
@transfix
transfix merged commit 1c10a1e into master Jul 21, 2026
4 of 8 checks passed
@transfix
transfix deleted the fix/flaky-multiprocess-ipc-run-serial branch July 21, 2026 07:24
transfix added a commit that referenced this pull request Sep 4, 2026
…325)

#121 moved the fork()+IPC multiprocess tests off the parallel ctest
scheduler because their socket and replication windows get starved under
load, producing failures that say nothing about the code. It covered
state_exec_multiprocess_test and state_multiprocess_ipc_test.

state_transport_ipc_test has the same profile -- real Unix-domain sockets
driven with poll() timeouts -- and was left on the parallel scheduler.
It still flakes: StateTransportIpcTest.TwoEndpointConvergence was the single
failure out of 2739 tests on an unrelated PR (#324, an SDF header fix that
touches nothing near state or IPC), which is what surfaced the gap.

Same one-line treatment as its two siblings.
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.

1 participant