Skip to content

Commit e1efd9d

Browse files
committed
test(daemon-ipc): 10s onset budget for the startup-lock observation waits
Both Windows rendezvous tests poll for the startup thread to be observed holding cbm-startup-v2.lock. That state is stable once reached — the test's own reader lock blocks the rendezvous write, so the startup lock stays held — only the onset (thread spawn + IPC preamble) is timing-dependent, and the 200ms budget missed it on a starved x64 runner (release run 30322785509, test_daemon_ipc.c:1075 ASSERT(startup_observed), first occurrence in 6 runs). Raise both onset budgets to 10s; a healthy run still exits on first observation. Per the flaky-test ladder this is the legitimate budget case: stable awaited state, budget as the sole flake source. Signed-off-by: Martin Vogel <martin.vogel.tech@gmail.com>
1 parent d90986b commit e1efd9d

1 file changed

Lines changed: 15 additions & 4 deletions

File tree

tests/test_daemon_ipc.c

Lines changed: 15 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1048,7 +1048,13 @@ TEST(daemon_ipc_windows_startup_retries_transient_rendezvous_reader) {
10481048
if (record_status == CBM_PRIVATE_FILE_LOCK_OK) {
10491049
thread_started = cbm_thread_create(&thread, 0, ipc_test_win_startup_call, &call) == 0;
10501050
}
1051-
for (size_t attempt = 0; thread_started && attempt < 200U; attempt++) {
1051+
/* Onset wait: once the startup thread reaches its startup lock it HOLDS it
1052+
* for as long as this test's reader lock blocks the rendezvous write, so
1053+
* the observed state is stable — only the onset (thread spawn + IPC
1054+
* preamble) is timing-dependent, and 200ms missed it on a starved x64
1055+
* runner (release run 30322785509). 10s bounds a wedged spawn; a healthy
1056+
* run still exits on first observation. */
1057+
for (size_t attempt = 0; thread_started && attempt < 10000U; attempt++) {
10521058
if (ipc_test_win_lock_busy(directory, "cbm-startup-v2.lock")) {
10531059
startup_observed = true;
10541060
break;
@@ -1126,7 +1132,13 @@ TEST(daemon_ipc_windows_rendezvous_bridges_concurrent_lifetime_owner) {
11261132
if (record_status == CBM_PRIVATE_FILE_LOCK_OK) {
11271133
thread_started = cbm_thread_create(&thread, 0, ipc_test_win_startup_call, &call) == 0;
11281134
}
1129-
for (size_t attempt = 0; thread_started && attempt < 200U; attempt++) {
1135+
/* Onset wait: once the startup thread reaches its startup lock it HOLDS it
1136+
* for as long as this test's reader lock blocks the rendezvous write, so
1137+
* the observed state is stable — only the onset (thread spawn + IPC
1138+
* preamble) is timing-dependent, and 200ms missed it on a starved x64
1139+
* runner (release run 30322785509). 10s bounds a wedged spawn; a healthy
1140+
* run still exits on first observation. */
1141+
for (size_t attempt = 0; thread_started && attempt < 10000U; attempt++) {
11301142
if (ipc_test_win_lock_busy(directory, "cbm-startup-v2.lock")) {
11311143
startup_observed = true;
11321144
break;
@@ -1534,8 +1546,7 @@ TEST(daemon_ipc_endpoint_is_namespaced_by_instance_key) {
15341546
if (a_startup_status == 1 && !cbm_daemon_ipc_startup_lock_prepare_handoff(a_startup)) {
15351547
a_startup_status = -1;
15361548
}
1537-
if (other_startup_status == 1 &&
1538-
!cbm_daemon_ipc_startup_lock_prepare_handoff(other_startup)) {
1549+
if (other_startup_status == 1 && !cbm_daemon_ipc_startup_lock_prepare_handoff(other_startup)) {
15391550
other_startup_status = -1;
15401551
}
15411552
cbm_daemon_ipc_startup_lock_release(&a_startup);

0 commit comments

Comments
 (0)