From b2b1a30762f2bc9c6319f93644b0c62c5e8179ee Mon Sep 17 00:00:00 2001 From: Adam Malczewski Date: Mon, 15 Jun 2026 20:38:32 +0900 Subject: rules: add test-determinism (condition-based client pumping, no thread+sleep) Crystallizes the scar behind the Wave-1b de-flake: headless integration tests must drive a real client by condition-based event-loop pumping, never a free- running thread + time budget (which starves under load -> sentinel reads / silent skips / drifting assertion count). --- .unbox/rules/test-determinism.md | 7 +++++++ 1 file changed, 7 insertions(+) create mode 100644 .unbox/rules/test-determinism.md diff --git a/.unbox/rules/test-determinism.md b/.unbox/rules/test-determinism.md new file mode 100644 index 0000000..d734bd6 --- /dev/null +++ b/.unbox/rules/test-determinism.md @@ -0,0 +1,7 @@ +# test-determinism +Headless integration tests that drive a real Wayland client MUST advance it by +CONDITION-BASED cooperative event-loop pumping (round-trip / dispatch until the +expected state is observed, with a bounded spin) — never a free-running client +thread + sleep/time budget. The latter starves under load and flakes: assertions +read sentinels or the case silently skips, so the doctest assertion COUNT drifts. +A correct test has an identical assertion count on every run. -- cgit v1.2.3