Skip to content

test(windows): stop the cross-process test starving itself on a loaded runner - #1251

Merged
iamtoruk merged 1 commit into
mainfrom
fix/xproc-test-contention-budget
Sep 3, 2026
Merged

test(windows): stop the cross-process test starving itself on a loaded runner#1251
iamtoruk merged 1 commit into
mainfrom
fix/xproc-test-contention-budget

Conversation

@iamtoruk

@iamtoruk iamtoruk commented Sep 3, 2026

Copy link
Copy Markdown
Member

main went red on the merge of #1248: check (ubuntu-latest) failed with

called `Result::unwrap()` on an `Err` value: could not lock
  /tmp/.../.windows-dock.lock within 2s; another process is writing these
  preferences, so nothing was changed

Not 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:

result
CB_TRAY_XPROC_NOLOCK=1 10/10 FAIL
lock enabled 10/10 PASS

So 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.

…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.
@iamtoruk
iamtoruk merged commit 01e5a76 into main Sep 3, 2026
13 checks passed
@iamtoruk
iamtoruk deleted the fix/xproc-test-contention-budget branch September 3, 2026 20:04
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