test(core): de-flake supervision props strategy scenario (#100)#110
Merged
Conversation
The real-actor property scenario (`law_strategy_restart_set` → `run_strategy_trial`) is the only path in supervision.properties.feature that spawns real actors, and it carried the last bare fixed-duration settle sleep in the file: a `tokio::time::sleep(NEGATIVE_BOUND)` used as a passive barrier before reading the restarted set. A fixed sleep is not a synchronization primitive — under CI scheduling load (a 2-core runner under llvm-cov) it races the async restart path. Replace it with an active bounded `hold_for` over the out-of-set children: it re-checks throughout the negative window and panics loudly the moment a spurious restart appears, instead of reading state once at the end. The independent restarted-set observation the caller compares to the oracle is preserved. Also raise the positive-observation bound `SETTLE_STEPS` 600 → 2000. `settle` returns the instant its condition holds, so a generous bound is free for a passing run; it only widens the margin before a genuinely scheduler-starved restart is declared a failure. Side effect: OneForAll trials have an empty out-of-set and now skip the negative window entirely, so the scenario runs ~3.7s instead of ~7s. Verified: 336 whole-binary stress runs + 64k in-process cascade trials + 150 hardened runs, all under heavy CPU oversubscription, zero failures.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #100.
Finding
The card's premise — "a fixed-duration
sleepused as a settle barrier races under load" — was stale for the current code. At card #77 the suite was rewritten to a condition-basedsettle()that is iteration-bounded, so its effective timeout self-scales with load. The one genuine residual was a baretokio::time::sleep(NEGATIVE_BOUND)inrun_strategy_trial— the only real-actor path insupervision.properties.feature. There is no proptest in this path, so the card's "commit a regression seed" prong does not apply.Change (test-only)
sleep(NEGATIVE_BOUND)with an activehold_forover the out-of-set children: it re-checks across the negative window and fails loudly the moment a spurious restart appears, instead of reading state once at the end. The independent restarted-set observation the caller compares to the oracle is preserved.SETTLE_STEPS600 → 2000.settlereturns the instant its condition holds, so a generous positive bound is free for a passing run; it only widens the margin before a genuinely scheduler-starved restart (a 2-core CI runner under llvm-cov) is declared a failure.No public API change, no coverage movement → no README/coverage-baseline update.
Verification
Could not reproduce on a 14-core dev box. 336 whole-binary runs + 64k in-process cascade trials + 150 hardened runs, all under heavy CPU oversubscription — zero failures.
nix flake checkgreen (incl.bombay-nextest).Side effect: scenario runtime ~7s → ~3.7s (OneForAll trials have an empty out-of-set and now skip the negative window entirely).