Skip to content

Commit 8d487b7

Browse files
committed
test(daemon): scale the frontend announce backstop with the build
`test-msan` failed the two backpressure cases while every other lane was green, and the same suite passes under MSan locally (12/12). The wait that fired is a LIVENESS BACKSTOP, not a race budget: the daemon child either announces on its ready pipe or it does not, and the test asserts the announcement itself, never a timing window. A backstop only does its job if it never fires on a legitimately slow start. 30s was already the second value here — the first was below the daemon's own 12s cohort-claim budget and SIGKILLed healthy startups on oversubscribed runners. Under MemorySanitizer, with instrumented libc++ and origin tracking, startup runs several times slower than that same budget it has to clear, so 30s stopped being a backstop and started being a verdict. Sanitized builds now get 180s, matching the existing sanitizer-aware pattern in test_cs_lsp_bench.c. This costs nothing when the daemon is healthy: a passing run returns the moment the byte arrives, whatever the ceiling. Nothing about the asserted state changed, and the non-sanitized bound is untouched. Signed-off-by: Martin Vogel <martin.vogel.tech@gmail.com>
1 parent ff853ac commit 8d487b7

1 file changed

Lines changed: 21 additions & 3 deletions

File tree

‎tests/test_daemon_frontend.c‎

Lines changed: 21 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -830,9 +830,27 @@ static bool frontend_backpressure_run_isolated(bool maintenance) {
830830
* below that budget SIGKILLs a slow-but-legitimate startup — on
831831
* oversubscribed CI runners this fired every round (announced=0,
832832
* daemon_signal=9) while fast local machines never saw it. Keep the
833-
* deadline comfortably above the daemon's own worst-case budget. */
834-
bool announced_read = daemon > 0 && frontend_test_read_byte(ready_pipe[0], &announced_marker,
835-
cbm_now_ms() + 30000U);
833+
* deadline comfortably above the daemon's own worst-case budget.
834+
*
835+
* This wait is a LIVENESS BACKSTOP, not a race budget: the daemon either
836+
* announces or it does not, and the test asserts the announcement, never a
837+
* timing window. A backstop is only doing its job if it never fires on a
838+
* legitimately slow start — so it has to scale with the build. Under
839+
* MemorySanitizer (instrumented libc++ and origin tracking) startup runs
840+
* several times slower than the 12s budget it must clear, which is what
841+
* reddened test-msan while every other lane and the same suite under local
842+
* MSan stayed green. Widening the backstop for sanitized builds costs
843+
* nothing when the daemon is healthy: a passing run returns as soon as the
844+
* byte arrives, whatever the ceiling is. */
845+
#if defined(CBM_SANITIZED_BUILD) || defined(__SANITIZE_ADDRESS__) || \
846+
defined(__SANITIZE_MEMORY__) || defined(__SANITIZE_THREAD__)
847+
const uint64_t announce_backstop_ms = 180000U;
848+
#else
849+
const uint64_t announce_backstop_ms = 30000U;
850+
#endif
851+
bool announced_read =
852+
daemon > 0 && frontend_test_read_byte(ready_pipe[0], &announced_marker,
853+
cbm_now_ms() + announce_backstop_ms);
836854
bool announced = announced_read && announced_marker == 'R';
837855

838856
/* This raw runtime client intentionally owns no cohort lease. It is a

0 commit comments

Comments
 (0)