Repository navigation
test(mcpx): make the orphaned-session test name its own failure mode - #336
Merged
Merged
Conversation
…290) TestTerminateOrphanedSessionEndsTheUpstreamSession flaked in the Nix build with '0 DELETE(s)', and the test discarded everything that could say why: the mock counted only DELETEs for live sessions (a DELETE for a forgotten session is answered 404 and counted as nothing) and the test never looked at the upstream.session.orphaned events that carry TerminateOrphanedSession's failure reason. - sessionUpstream now records every DELETE attempt and its session id, like the daemon package's orphanUpstream already does. - The test captures terminated and orphaned events together (new lifecycleCapture helper; the existing helper's hook holds one kind) and its failure message reports attempts, session ids and the orphaned reasons. The three failure modes now read differently: no DELETE arrived (attempts=0), the DELETE named a session the upstream had forgotten (attempts=1, terminated still fires — 404 is success by design), or the DELETE errored (orphaned event with the reason). Verified with a sabotage run (upstream forgets the session before termination). Test-only change; full internal/pool suite green, -count=200 and -race runs of the target test green locally (the flake itself is Nix-sandbox only and does not reproduce in a dev environment).
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes the diagnosability half of #290 (the Nix-build flake itself does not reproduce locally — see below).
Problem
TestTerminateOrphanedSessionEndsTheUpstreamSessionflaked in the Nix build gate withthe orphaned session saw 0 DELETE(s)(PR #275's run 39121884524), and the test discarded the evidence that would identify the cause:upstream.session.orphanedevents, which are exactly whereTerminateOrphanedSessionreports why a termination failed.Fix (test-only)
sessionUpstreamrecords every DELETE attempt and its session id (the daemon package'sorphanUpstreammock already does this — the pool mock now matches it).lifecycleCapturehelper (the existinglifecycleEventshook can hold only one kind), and its failure message reports attempts, session ids, and orphaned reasons.The three failure modes now read differently:
attempts=0(+ orphaned reason if the dial errored);attempts=1, deleted=[sess-1], deletes=0, terminated still fires (404 is success by design incloseSession);Verification
internal/poolsuite green; target test-count=200,GOMAXPROCS=1 -count=100and-racegreen locally. The flake is Nix-sandbox-only (100/100 local passes pre-fix, per mcpx: TestTerminateOrphanedSessionEndsTheUpstreamSession flakes in the Nix build (0 DELETEs) and hides its own failure reason #290), so mcpx: TestTerminateOrphanedSessionEndsTheUpstreamSession flakes in the Nix build (0 DELETEs) and hides its own failure reason #290 stays open until a future Nix-build flake prints its mode — or repeated green builds close it.Refs #290
Need help on this PR? Tag
@codesmith-botwith what you need.Summary by CodeRabbit