emrg: renderer shell test — waitFor the Edit form name prefill (fix flaky taskUpdate test) - #1038
Conversation
3fa39e0 to
186e007Compareargszero
commented
Aug 27, 2026
Rebased this PR onto the current master (after #1035 and #1036 merged) so it applies cleanly. The change is isolated to Shell.test.tsx: the Edit test read name.value immediately after the task-form dialog appeared, but TaskFormDialog populates name via a useEffect that runs after mount. Under the #1035 polling test's fake-timer timing this occasionally read the prefill late, causing a false-red master CI. The fix wraps the assertion in waitFor — the same pattern as #1031. Renderer count stays 445 (no test added, robustness-only). CI green, MERGEABLE/CLEAN. |
…laky taskUpdate test) The '任务行 Edit' test read name.value immediately after the dialog appeared, but TaskFormDialog populates the name via a useEffect that runs after mount. Under #1035's fake-timer polling test timing, this could read the prefill late and flake (false-red master CI). Wrap the prefill assertion in waitFor (identical to the #1031 DialogHost rename fix).
186e007 to
89d9e0dCompareargszero
commented
Aug 27, 2026
Rebased again after #1037 merged (the fork base predated it, so its Agent.md still showed GUI 89 — would have silently reverted the boot-contract count). Rebased onto master d3e87af: the diff is now a clean single-file change to Shell.test.tsx (the waitFor-prefill fix, +4/-1); Agent.md GUI stays 92 (boot-contract preserved) and renderer stays 445. Doc-count guard 4/4, Shell test 24/24, renderer 445/445. CI 33038788769 green (test + test-windows), MERGEABLE/CLEAN. |
argszero
left a comment
There was a problem hiding this comment.
✅ LGTM — cycle 122224. Rebased onto master d3e87af, single-file change to Shell.test.tsx (waitFor the Edit form prefill, +4/-1), Agent.md GUI stays 92 / renderer stays 445, doc-count guard 4/4 passes locally, CI 33038788769 green (test + test-windows), MERGEABLE/CLEAN. Robustness-only fix, correct waitFor pattern.
argszero
left a comment
There was a problem hiding this comment.
✅ LGTM — cycle 123632. Re-verified head 89d9e0d unchanged (2nd consecutive approval, no ❌ in between). Single-file fix to Shell.test.tsx wrapping the task-form-name prefill assertion in waitFor (correct pattern mirroring #1031; TaskFormDialog populates name via a post-mount useEffect). CI 33038788769 green (test + test-windows), MERGEABLE/CLEAN. Robustness-only, no test count change.
argszero
left a comment
There was a problem hiding this comment.
✅ LGTM — cycle 124605. 3rd consecutive approval (122224→123632→124605, no ❌ in between). Re-verified head 89d9e0d unchanged, CI 33038788769 green (test + test-windows), MERGEABLE/CLEAN. Single-file robustness fix (waitFor the useEffect-populated Edit prefill), correct pattern mirroring #1031. Merge gate satisfied — proceeding to merge.
Uh oh!
There was an error while loading. Please reload this page.
Summary
The renderer test
任务行「Edit」→ 表单预填 + name 只读 → 保存 → taskUpdateinemrg/gui/renderer/src/components/Shell.test.tsxwas intermittently flaky — it caused a false-red on master CI after #1035.Root cause
The test asserted
name.value === "evo"immediately afterwaitFor(task-form-dialog). ButTaskFormDialogpopulates the name field via auseEffect(vanillaopenTaskFormsemantics) that runs after the dialog mounts. Readingname.valuebefore the effect runs returns an empty string. The #1035 polling test (which usesvi.useFakeTimers()+advanceTimersByTime) occasionally shifts timing such that this race surfaces.This is the same class of timing bug fixed in #1031 (DialogHost rename prefill).
Fix
Wrap the prefill assertion in
waitForso the effect has populated the field before reading it:Verification
emrg/gui/renderernpm run typecheck— cleanemrg/gui/renderernpx vitest run— 442/442 pass (no test count change; this is a robustness fix)emrg/gui/renderernpx vitest run src/components/Shell.test.tsx— 24/24 pass