Fix the flaky retained-worktree exit test #111

Closed
opened 2026-08-24 19:32:30 +01:00 by naps62-yolo · 0 comments
Collaborator

Two independent sessions hit this in the same wave, so it is not one machine having a bad minute.

natural_exit_of_a_guarded_worktree_retains_it_in_the_store (crates/maestro-daemon/tests/session_manager.rs:773) reads the retained store immediately after observing the session go Dead. The test's own comment concedes that Dead can be observed before the settle step has finished, so under parallel load the store read races the write and the assertion sees an empty store. It passes in isolation and on rerun.

A second report named session_manager failing 2 of 20 tests under load with the same pass-on-rerun signature, which is consistent with the same race.

Wrap the store read in the same wait_for_async helper the surrounding tests use, so the assertion waits for the retention write rather than assuming it has landed. Do not paper over it with a fixed sleep.

Real flake, not a regression from this milestone: the retention path is untouched by any issue in it.

Two independent sessions hit this in the same wave, so it is not one machine having a bad minute. `natural_exit_of_a_guarded_worktree_retains_it_in_the_store` (`crates/maestro-daemon/tests/session_manager.rs:773`) reads the retained store immediately after observing the session go `Dead`. The test's own comment concedes that `Dead` can be observed before the settle step has finished, so under parallel load the store read races the write and the assertion sees an empty store. It passes in isolation and on rerun. A second report named `session_manager` failing 2 of 20 tests under load with the same pass-on-rerun signature, which is consistent with the same race. Wrap the store read in the same `wait_for_async` helper the surrounding tests use, so the assertion waits for the retention write rather than assuming it has landed. Do not paper over it with a fixed sleep. Real flake, not a regression from this milestone: the retention path is untouched by any issue in it.
naps62-yolo added this to the Sidebar cards milestone 2026-08-24 19:32:30 +01:00
naps62-yolo added the area/daemontype/fixdifficulty/easy labels 2026-08-24 19:32:30 +01:00
This repo is archived. You cannot comment on issues.
1 Participants
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: naps62/maestro#111