Repository navigation
Wait for the panel's drawn status so the board test stops flaking in merge groups - #1850
Conversation
The memory-save assertion in project-board-panels clicked the button, waited a fixed ten ticks and read the status line. On a loaded runner the host answers later, so it read whatever the previous test left behind — the hook slots are module-level and `render` reset only the cursor (ThinkFlowLab#1843). That ejected ThinkFlowLab#1825 from the merge queue once (red run, then green at the same tip). Each test now starts from empty slots, and the three status assertions poll the text the panel draws, bounded so a real regression still fails on the value it reads. The primitive is retired-bot-paths.test.js's `waitFor` (ThinkFlowLab#1834), kept local to this file. The whole file is mirrored byte for byte. Fixes ThinkFlowLab#1843 Owner: Dev3 Reviewer: Reviewer Docs-not-needed: test-only change to one timing assertion and its whole-file mirror; no owned path or behaviour changes.
|
Verdict: PASS at ed4ddb9 Ran at this tip: Red first. The base blob of Scope. Tier. Risk gate reported Checks at the tip. 14 check runs, all Not run: the smoke test (no |
Replayed onto d2367cd by Replay: the same change set on the current main, so patches/ds-bot/ merges and #1813's board-state i18n keys stay. Generated client.js and patches/ds-bot/ are rebuilt from core/; topics.json is main's. No 0017-project-chief.patch is emitted. The client doc gains the Members-panel Chief row, which arch-docs requires for core/src/client/project-board.js. main's #1850 wait-for-status fix in project-board-panels.test.js is kept, with this branch's members-panel assertion applied on top.
Fixes #1843
Written-by: Dev3
Owner: Dev3
Reviewer: Reviewer
Claim-Id: bbcd50297ba84d3dad4f26da8e7b5dae
Branch: dev/3-flaky-panel-state
Base: 28e887b
Docs-not-needed: test-only change to one timing assertion and its whole-file mirror; no owned path or behaviour changes.
What was wrong
core/test/project-board-panels.test.jswas order-dependent and failed at random on merge groups — it ejected #1825 once: run41046947850red, run41047579302green at the same tip33a5d463. Both reds named the same assertion:Two defects, both in the test harness, no production code involved:
core/test/project-board-panels.test.js:33-34) andrender()resets only the cursor (:58), never the slots. A value one test clicked therefore stayed readable by the next test — the bind/assistant test leaves'Assistant settings saved.'in the status slot.settle()was a fixed ten event-loop ticks (:77), not a wait for the host's answer. On a loaded runner the memory save had not landed when the assertion re-rendered, so it read the stale line above.What changed
resetSlots()), so nothing one test clicks can be another test's value.waitFor/statusAfter, 100 polls of 25 ms, bounded) instead of waiting a number of ticks. A timeout still fails on the value it reads, as the CI failure does above. The one-tick read in the last refusal test is the same defect class, so it uses the primitive too.core/test/retired-bot-paths.test.jsadopted in test(retired-bot-paths): wait for both reviews instead of fixed settles (#1833) #1834, kept local to this file (no shared helper). test(retired-bot-paths): wait for both reviews instead of fixed settles (#1833) #1834 had no cross-test hook-slot sharing to fix, so only the wait applies there; the per-test slot reset is specific to this file.core/test/project-board-panels.test.jsandpatches/ds-bot/files/test/project-board-panels.test.jsare byte-identical (sha256521a123d269a73decae6b026202bfbc288e02c1803e803f882ebebcac170e6e8, 14,725 bytes each).retired-bot-paths.test.jsis untouched.Red first, on base
28e887b8The CI order (bind/assistant test first, memory save after it) run twice in one process on an idle machine does not reproduce it: 12/12 green both times. On an idle runner the ten ticks suffice, which is why this only reds merge groups.
The red needs the load, so I reproduced it with the condition that made it flaky: a scratch copy of the base file with a 120 ms delay on
project-memory-write.That is deterministic, and the order dependence shows in the actual value, not only the timing: with the same delay, moving the memory-save test before the bind/assistant test makes the value
''— the stale line is whatever the previous test left. Removing the wait entirely fails the same way, so the two defects are independently sufficient.Verification at the tip
ed4ddb9c73ad5e7de36f39fcbc0d1dcc6a8bc5ddRan:
node --import ./test/harness-resolve.mjs --test test/project-board-panels.test.js): 20/20 green, 6/6 tests each.TZ=UTC ARCH_DOCS_BASE=28e887b8 npm run verifyon the committed tree (git status --porcelainempty): exit 0 — core 2221/2221; core lint 72 warnings, 0 errors; plugin lints 36 / 9 / 2 / 16 warnings, 0 errors;arch-docs: OK (2 changed file(s));build-client --checkgreen;ds-bot-patches check10 patches apply cleanly in order andcore/ equals ds-bot/ + patches/ds-bot/; plugins social 541, tree 127, timeline 135, workflow 294;.github/scripts549; interop 37, live-e2e 24 — 0 failures everywhere.Not run:
tests-okat this tip — that is the check this PR exists to stop flaking; it must be green before queueing.index.jsorsrc/host/change.Checkpoint
{ "pr": 1850, "claim": "Dev3", "issue": 1843, "summary": "The panel test file kept hook slots across tests and waited a fixed ten ticks, so a loaded runner read the previous test's status line. Each test now starts from empty slots, and the status assertions poll the drawn text with a bounded wait. The wait primitive stays local to this file and mirrors the one #1834 adopted; nothing in production code changes. The file is green 20 runs in a row and with the two blocks swapped, and under the 120 ms delay that reds the old file.", "files": [ "core/test/project-board-panels.test.js", "patches/ds-bot/files/test/project-board-panels.test.js" ], "checks": { "ran": "20 consecutive runs; swapped-order runs; 120 ms delay probes; TZ=UTC ARCH_DOCS_BASE=28e887b8 npm run verify; ds-bot-patches check; build-client --check", "result": "green", "at": "ed4ddb9c73ad5e7de36f39fcbc0d1dcc6a8bc5dd" }, "next": "none — ready for review" }