test: move-codex-session editor helper should wait for the script #146
Loading…
Reference in a new issue
No description provided.
Delete branch "test/move-codex-session-editor-helper"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Closes #141. The editor helper could throw before awaiting the script, and its callers then deleted the fixture under a live script. It now settles the editor and the script together. If both fail, it throws an
AggregateError. If only the editor fails, the error carries the script's exit status and stderr, with the editor error ascause. If only the script fails, its own error propagates.Beyond #141, the history and goals tests no longer rely on a fixed 3 s editor window. The editor holds the edited database's write lock and polls the destination state database with a
timeout: 0BEGIN IMMEDIATE. A busy result means the script's final re-check holds the state lock, so the comparison is over and the editor commits.In 82 traced runs (up to 16 in parallel), the probe always fired after the script took the state lock and before it took the edited database's lock. Removing the re-check, reading digests before locking, and using a plain
BEGINin the script each make these tests fail. The three callers passed 10 of 10 runs, and 5 of 5 under 32 CPU hogs.The state test keeps a bounded 15 s wait (
STATE_EDIT_WINDOW_MS, under the script's 30 s lock wait). State is the first lock, so nothing is observable there, and polling for copied rows fails an earlier verification. The suite is about 12 s slower. A deterministic wait would need a pause hook in the script, which this PR leaves out.🤖 Generated with Claude Code
move-codex-sessioneditor helper should wait for the script 29eb676028move-codex-sessioneditor helper should report the script's result and take an explicit waitReview
01M4JC2KV7J7ENY61TKM3DP5X5— head3a20e5f00b34e1315e5d30c6e5225035f766c863Review — j4k-oss/agent-skills @
aaa8e581a8Scope: diff against base tree
e33d8035a418Status: dispatched — coverage complete (5/5 slots terminal)
Facts: current review-wide projection
Computed under:
Findings (0)
No findings survived.
Reviewed:
Other claims
Coverage
Coverage pass: 01M4JC2Z39FFK7RVRXXQ6G5HR4
Accounting: complete
Slot health: healthy
@ -480,0 +497,4 @@// The state database is the first lock, so a script waiting on it holds nothing to observe; the edit waits out a window.function moveWhileStateIsEdited(fixture: Fixture, statement: string): Promise<MoveResult> {return moveWhileEditing(fixture, fixture.destinationStatePath, statement, async (scriptHasExited) => {const windowEnd = Date.now() + STATE_EDIT_WINDOW_MS;low — The state deletion race test relies on an arbitrary 15-second window
lens
general-bug· armdefault· tally 1 valid / 0 invalid / 0 uncertainclaim
01M4JBRRGQV1NXA6SD25A537DCof review01M4JBP5GFGV3DP31BC6RBFQBVsuperseded by review
01M4JC2KV7J7ENY61TKM3DP5X5for head3a20e5f00b34e1315e5d30c6e5225035f766c8632f54a7801a3a20e5f00b