test(daemon): let the exit waits race the create's publish #80

Merged
natsukium merged 1 commit from fix/held-row-publish-race-20 into main 2026-09-04 19:08:36 +09:00
Owner

Follow-up to #79, which turned main's cargo build / clippy / test / deny
job red on a load-sensitive test.

A create publishes its pool row after writing the ack, so a test that
reads its own ack and then looks the session up by name can arrive in the
instant before the publish. Both post-exit waits in
crates/felis-daemon/src/serve/tests.rs treated an absent handle as a
failed premise and panicked with "the graced session must stay in the
pool"; they now retry until their own deadline, which is the order
docs/explanation/architecture/session-lifecycle.md documents. Daemon
behavior is unchanged — this is a test-side fix.

Verified: the two affected tests pass repeatedly under --test-threads 16
(the shape that reproduced the failure locally), plus
cargo clippy -p felis-daemon --all-targets -D warnings and
cargo fmt --check.

Follow-up to #79, which turned main's `cargo build / clippy / test / deny` job red on a load-sensitive test. A create publishes its pool row after writing the ack, so a test that reads its own ack and then looks the session up by name can arrive in the instant before the publish. Both post-exit waits in `crates/felis-daemon/src/serve/tests.rs` treated an absent handle as a failed premise and panicked with "the graced session must stay in the pool"; they now retry until their own deadline, which is the order `docs/explanation/architecture/session-lifecycle.md` documents. Daemon behavior is unchanged — this is a test-side fix. Verified: the two affected tests pass repeatedly under `--test-threads 16` (the shape that reproduced the failure locally), plus `cargo clippy -p felis-daemon --all-targets -D warnings` and `cargo fmt --check`.
test(daemon): let the exit waits race the create's publish
Some checks failed
darwin / build felis (aarch64-darwin) (pull_request) Successful in 51s
bench / Criterion regression gate (pull_request) Failing after 2m9s
windows / cargo nextest (Windows) (pull_request) Successful in 6m20s
pr / frontend smoke (x86_64-linux) (pull_request) Successful in 1m56s
pr / publish felis (x86_64-linux) (pull_request) Has been skipped
pr / nix flake check (push) Successful in 8s
windows / frontend smoke (Windows) (pull_request) Successful in 3m2s
windows / package felis (x86_64-pc-windows-msvc) (pull_request) Has been skipped
windows / cargo clippy (Windows cross) (pull_request) Successful in 28s
fuzz / cargo fuzz nightly long-run (push) Has been skipped
fuzz / cargo fuzz smoke (per target) (pull_request) Successful in 1m34s
pr / nix flake check (pull_request) Successful in 45s
pr / cargo build / clippy / test / deny (pull_request) Successful in 2m12s
pr / wire schema is compatible with the base (pull_request) Successful in 14s
bench / Criterion full-suite snapshot (pull_request) Has been skipped
fuzz / cargo fuzz nightly long-run (pull_request) Has been skipped
darwin / build felis (aarch64-darwin) (push) Successful in 13s
fuzz / cargo fuzz smoke (per target) (push) Successful in 1m35s
pr / wire schema is compatible with the base (push) Successful in 8s
windows / cargo clippy (Windows cross) (push) Successful in 12s
pr / publish felis (x86_64-linux) (push) Successful in 10s
windows / cargo nextest (Windows) (push) Successful in 5m59s
pr / cargo build / clippy / test / deny (push) Successful in 1m44s
pr / frontend smoke (x86_64-linux) (push) Successful in 9s
windows / frontend smoke (Windows) (push) Successful in 2m17s
windows / package felis (x86_64-pc-windows-msvc) (push) Successful in 2m28s
3ddbacaae9
A create publishes its pool row after it writes the ack, so a test that
reads its own ack and then looks the session up by name can arrive in
the instant before the publish. Both post-exit waits treated an absent
handle as a failed premise and panicked with "the graced session must
stay in the pool", which is how
`a_live_only_attach_is_refused_on_a_corpse_but_a_deliberate_one_lands`
failed on a loaded runner while passing everywhere else. The waits now
retry an absent handle until their own deadline, which is what the
publication order documents (`architecture/session-lifecycle.md`).
natsukium deleted branch fix/held-row-publish-race-20 2026-09-04 19:08:36 +09:00
Sign in to join this conversation.
No description provided.