Repository navigation
test: pin the row fill's view check and de-time two waits - #2847
Conversation
- console-agents-list-return: add a case where a refocus holds the list (inert, still connected, no longer current) while a landed reread waits out its 150 ms; the held rows must stay unfilled. Kills the mutant that drops context.isCurrent() from the delayed fill (finding 1877). reveal() waits with page.waitForFunction instead of a 20 ms poll loop. - kubernetes-real-kubectl: the two-teardown late-cleanup test orders its steps with promises and one event-loop turn instead of 20/20/50 ms sleeps, checks the second teardown drains while the first's cleanup still runs, and checks both throws' messages (stopsSetup hoisted). - workspace-files-native: require an explicit "0" from the model-call counter, so empty output no longer passes (finding 1876).
|
🦞👀 Pull request received. I will update this pull request when review starts. ClawSweeper review completeClawSweeper finished reviewing this revision. The review result is being finalized. |
|
Codex review: needs maintainer review before merge. What this changesThis PR strengthens stale-row and cleanup-order tests, replaces timing-based waits, and requires explicit zero model-call output. Example: The native workspace test receives empty counter output.
Review scores
ProductKind: Test only · Worth it: Yes · Fix scope: Complete Merge readiness✅ Ready for maintainer review Keep open: this PR adds useful, distinct regression coverage without changing product behavior. No actionable introduced defect was found. Priority: P3 Before mergeNone. FindingsNone. Agent review detailsHow this fits togetherThe existing browser, conformance, and native-runtime suites exercise console view lifetimes, test-resource cleanup, and workspace operations, then assert DOM state, cleanup ordering, and model-call observations. flowchart TB
T[Test suites] --> C[Console view lifecycle]
C --> D[Held row assertions]
T --> H[Bounded teardown helper]
H --> O[Independent cleanup assertions]
T --> N[Native workspace runtime]
N --> Z[Explicit zero assertion]
Technical reviewBest possible solution: Retain the focused assertions and deterministic coordination in the existing suites. Do we have a high-confidence way to reproduce the issue? Source inspection confirms that empty counter output passes the old numeric assertion and that the old cleanup assertion permits serialization; the PR also reports targeted mutation comparisons for the added browser case. Is this the best way to solve the issue? The patch strengthens existing test owners without adding production seams, duplicating a capability, or changing the runtime contract. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 6f62cbd9ea28. Provenance checked
TestingProof path: in-process harness. SecurityNone. EvidenceWhat I checked:
Review metrics
LabelsLabel changes:
Label justifications:
Rating scale6/6 🦀 challenger crab · 5/6 🦞 diamond lobster · 4/6 🐚 platinum hermit · 3/6 🦐 gold shrimp · 2/6 🦪 silver shellfish · 1/6 🧂 unranked krab. Overall follows the weaker of proof and patch quality; ✨ marks media proof (a screenshot, video, or linked artifact) that directly shows the changed behavior. WorkflowClawSweeper edits this one comment on every review. Comment Reviewed October 18, 2026, 9:01 AM ET / 13:01 UTC. |
… the held-view read Review nits: the second after() assert now sits inside the try, so a failure never leaves the first cleanup holding the file for its step limit; a comment says why the held list is read directly.
freeqaz-openai
left a comment
There was a problem hiding this comment.
I would keep this change. I checked that the new teardown test catches a real loss of coverage: in a disposable copy, I made two teardowns share one late-cleanup queue. The test on main passed with that defect. This version failed because the second cleanup had not run while the first was held, then passed with the actual per-teardown queues. The finally also releases the held cleanup if the assertion fails.
The other two changes make sense: the browser test observes the old list while it is still present but inert, and the native workspace test no longer mistakes empty output for an observed zero.
I verified the hosted results on the merge preview of 6f62cbd9 + 2b85ca7b: 339 browser, 2,579 conformance/baseline, and 18 runtime-startup cases passed, including all three changed cases. My review covers source and those results; the visible ClawSweeper verdict still names the previous head, so I am leaving final review and merge with the owner.
Problem
A survey of the tests added or changed on 2026-10-18 (outside files that open PRs touch) found three gaps:
apps/controller/src/console/agents/list.mjs: the delayed row fill checkscontext.isCurrent() && reading.isConnected. No test pinned thecontext.isCurrent()half. Dropping it passed all 12 row-reading tests inconsole-agents-list-return.tests/integration/workspace-files-native.test.mjsstill comparedNumber(counter.stdout.trim())with0, so empty counter output passed (Number("") === 0). Require an explicit zero in runtime listener tests #2838 fixed the same pattern in the native listener test.kubernetes-real-kubectl's two-teardown late-cleanup test ordered its steps with 20/20/50 ms sleeps.returnWithHeldRows().reveal()polledpage.evaluateevery 20 ms against a hand-rolled deadline.Change
This PR changes tests only.
reveal()now usespage.waitForFunctionwith the same 5 s bound in place of the poll loop.setImmediate). Late cleanups drain in microtasks, so that turn is enough.after()throws now check thestopsSetupmessage. That regex moved to module scope.finallyreleases the first cleanup, so a failing run never hangs the file.assert.equal(counter.stdout.trim(), "0").Verification
Test names are unchanged except for the one added case. No new files, so the suite mapping is unchanged.
Hand-made mutants in
list.mjs, run against the row-reading tests (13 with the new case):animationstartreading.isConnectedcontext.isCurrent()in the timerEach run's "After" result was the same before and after the
reveal()change.Mutants in
tests/helpers/kubernetes-real.mjs, run against the two-teardown test:A FIFO late order survives both versions here; the earlier late-cleanup test covers ordering.
20/20 on 2 CPUs (taskset) for
console-agents-list-returnandkubernetes-real-kubectl.workspace-files-nativeneeds prepared runtime images, so it is left to its CI lane.Prettier and ESLint are clean on the touched files.
Risks
Test-only. The new browser case uses the page clock and the hold pattern this file already uses.
workspace-files-nativeandkubernetes-real-kubectlkeep their CI lanes.