test(windows): stop the cross-process test starving itself on a loaded runner - #1251
Merged
Conversation
…d runner The test ran 100 rounds a side, both taking the lock, while a reader thread hammered the same file. Production allows a 2s wait with a 50ms poll, which suits a UI that writes on a click but starves under that much contention: a waiter that loses the race after each poll can exceed the budget, and the acquire then fails by design. That is what turned main red on the merge, not a lost update. 24 rounds a side keeps the property under test and the harness stops being the thing that fails. Measured on this machine, ten runs each way: the test still fails 10 out of 10 with CB_TRAY_XPROC_NOLOCK=1 and passes 10 out of 10 with the lock, so it detects the bug exactly as reliably as before. The production budget and poll are untouched. If sustained contention ever becomes a real workload rather than a test, the poll is the thing to revisit, not the budget.
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.
mainwent red on the merge of #1248:check (ubuntu-latest)failed withNot a lost update, and not a fault in the lock — the harness starved itself. It ran 100 rounds a side, both sides taking the lock, while a reader thread hammered the same file. Production allows a 2s wait with a 50ms poll, which is right for a UI that writes on a click but not for sustained contention: a waiter that loses the race after each poll can exceed the budget, and the acquire then fails exactly as designed. It passed on the PR branch and failed on main because the runner was busier.
24 rounds a side keeps the property under test. Measured here, ten runs each way:
CB_TRAY_XPROC_NOLOCK=1So it still catches a lost update exactly as reliably as before.
The production budget and poll are deliberately untouched — tuning shipped timings to make a test pass would be the wrong way round. If sustained contention ever becomes a real workload, the 50ms poll is the thing to revisit, since that is what allows starvation, not the 2s budget.