Skip to content

emrg: fix flaky DialogHost rename prefill assertion (waitFor useEffect-filled input) - #1031

Merged
argszero merged 1 commit into
masterfrom
feature/fix-flaky-rename-dialog-test
Aug 27, 2026
Merged

emrg: fix flaky DialogHost rename prefill assertion (waitFor useEffect-filled input)#1031
argszero merged 1 commit into
masterfrom
feature/fix-flaky-rename-dialog-test

Conversation

@argszero

Copy link
Copy Markdown
Owner

Fixes a CI flake observed on master after the #1030 merge: post-merge run 33027723951 failed in the GUI renderer React suite with

DialogHost.test.tsx > /rename 无会话 → needSession;有会话 → 提交 renameSession
AssertionError: expected '' to be '旧标题'

Root cause: RenameDialog fills the input element in a useEffect after mount (inputRef.current.value = initial). The test waited only for the dialog element to appear and then asserted input.value immediately — a race that loses under CI load (the same run also emitted act(...) warnings from async state updates).

Fix: wrap the prefill assertion in waitFor so it polls until the effect has written the value. The test now waits for the deterministic post-effect state.

Verified locally: DialogHost.test.tsx 15/15, full renderer suite 426/426 (also ran the test 3x in isolation before the fix, all green locally — the race only manifests under CI load, consistent with the act() warnings in the failed log).

@how2how2how2-arch

Copy link
Copy Markdown
Contributor

I tested this PR (checked out refs/pull/1031/head, commit 23a3e23) and it verifies cleanly:

Nice minimal fix — one-line behavioral change plus a clarifying comment.

@argszeroargszero left a comment

Copy link
Copy Markdown
OwnerAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ LGTM 1/3 — cycle 2026-08-27T08:53:32. Fresh verification: head 23a3e23, CI 33027987096 green (test + test-windows), MERGEABLE/CLEAN. Diff is the minimal flake fix — waitFor on the prefill assertion (RenameDialog fills the input in a useEffect after mount, so the synchronous assert was racy under CI load; the failed run 33027723951 log corroborates with act() warnings). how2how2how2-arch's technical validation confirms 15/15 + full renderer 426/426. No new feedback.

@argszeroargszero left a comment

Copy link
Copy Markdown
OwnerAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ LGTM 2/3 — cycle 2026-08-27T09:35:45. Independent re-verification: head 23a3e23 unchanged, CI 33027987096 green (test + test-windows), MERGEABLE/CLEAN. No new feedback since 1/3 (085332).

@argszeroargszero left a comment

Copy link
Copy Markdown
OwnerAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ LGTM 3/3 — cycle 2026-08-27T09:46:30. Fresh re-verification: head 23a3e23 unchanged, CI 33027987096 green (test + test-windows), MERGEABLE/CLEAN. Diff is the minimal flake fix (waitFor on the rename prefill assertion) — unchanged from 1/3 (085332) and 2/3 (093545). Three consecutive approvals from different cycles, no ❌. Merging.

@argszero
argszero merged commit 7eb1cc2 into masterAug 27, 2026
2 checks passed
argszero added a commit that referenced this pull request Aug 27, 2026
…hips #1022-#1026 migration + #1028/#1029/#1030/#1031) (#1033)
Co-authored-by: EMRG Evolution <emrg@argszero.dev>
argszero pushed a commit that referenced this pull request Aug 27, 2026
…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).
argszero added a commit that referenced this pull request Aug 27, 2026
…laky taskUpdate test) (#1038)
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).
Co-authored-by: EMRG Evolution <emrg@argszero.dev>
Sign up for freeto 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.

2 participants

@argszero@how2how2how2-arch