Skip to content

test(libmoq): session close flake was fixed by #9038; drop the comments it outdated - #9078

Merged
kixelated merged 2 commits into
mainfrom
quest/m0/test-flakes-3/c-server-accepts-session
Nov 18, 2026
Merged

kixelated merged 2 commits into
mainfrom
quest/m0/test-flakes-3/c-server-accepts-session

Conversation

@kixelated

@kixelated kixelated commented Nov 18, 2026 •

Copy link
Copy Markdown
Collaborator

Closes the quest quest/m0/test-flakes-3/c-server-accepts-session.md.

Problem

libmoq test::server_accepts_a_session sometimes failed with moq_session_close(client) returning -21 (MOQ_ERROR_SESSION_NOT_FOUND) instead of 0, mostly under a loaded just check (most recently on the heads of moq-dev/moq#9059 and moq-dev/moq#9061).

Cause: the reconnect policy treated a session closed before 1 s of uptime as a refusal and ended the whole loop. The test closes the accepted session within milliseconds, so the dialed client's loop ended and released its handle. The result depended on timing: the test failed only when the client saw the close before the test reached moq_session_close(client).

moq-dev/moq#9038 already fixed the library: a session is now established once the peer answers its credential (lite-06's SETUP reply), so after the server closes, the client backs off and redials as documented. Both failing heads above predate #9038. Its deterministic regression test is an_accepted_session_establishes_the_policy in rs/moq-net/src/reconnect/tests.rs, which runs on a paused clock. #9038 also removed a 1 s sleep that a_credential_rides_every_reconnect needed for the same reason.

Approach

No library change is needed. This PR:

Validation

Ran the test binary directly, 8 copies at a time across all 32 CPUs on a host already loaded by other agents (load about 35):

Build Runs Failures
16880c8371 (main just before #9038) 40 2, both left: -21, right: 0 at test.rs:8761
this branch (main after #9038) 200 0

Earlier on this branch: cargo nextest --stress-count 400 --test-threads 64 over both tests passed 400/400, and 24 copies pinned to one core passed 240/240. just check passes.

Impact

None. Test comments and quest file only. Public API: none. Wire: none.

Alternatives

  • Make the test wait for the client's terminal callback and assert the close is negative (the quest's fallback plan). Rejected: the client is supposed to keep redialing, and moq_session_close(client) == 0 asserts that.

Caused by

  • moq-dev/moq#8817 - a session closed before 1 s of uptime ended the reconnect loop even when the peer had accepted it, which made the client's handle disappear while the test still held it (found by check). Fixed by moq-dev/moq#9038.

Follow-ups

None.

Models

Size: S
Implementer: Claude Code, claude-opus-5-5, high effort

(Written by Claude Opus 5.5 with high)

Review

Rewritten by quest review after each round.

  • Head: 1c0c161

  • Base: origin/main at 4e73451

  • Risk: medium, the base has no RISK.md to name what is always high or customer-facing, so every change is medium

  • Classified: medium by default

  • Reviewer: Codex, gpt-6.1-sol, medium effort

  • Session: 01a1eebb-ebb4-7d10-b222-19d0b0249f89, round 1

  • Score: 10/10, The scoped diff only updates test comments and removes a resolved quest record, changing no executable behavior and leaving no actionable defects.

  • Rounds: 1; first round 0; findings 0: fixed 0, refuted 0, open 0

  • Findings: none

kixelated and others added 2 commits November 18, 2026 03:51
… fixed the close flake

The client's close returned SESSION_NOT_FOUND when the server closed the accepted
session first: before #9038 a session closed within 1s of uptime ended the
reconnect loop, racing the test's close. #9038 establishes a session once its
SETUP is answered, so the client now redials. Drop the comments that still
describe the old rule, and the finished quest.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@kixelated kixelated changed the title libmoq's session tests close their client after the server did test(libmoq): session close flake was fixed by #9038; drop the comments it outdated Nov 18, 2026
@kixelated
kixelated marked this pull request as ready for review November 18, 2026 12:58

@pullfrog pullfrog Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

✅ No new issues found.

Approach: sound — #9038 already fixed the library, so this only removes the stale workaround comments and states the rule the assertion depends on.

Reviewed changes: the full diff (comments in rs/libmoq tests plus a deleted quest file).

  • Stale comments removed: the three "close the client first" notes in announce_route_crosses_a_relay_session, a_minted_instance_pins_request_and_follow and parity::session_tokens_and_grants. The close order is unchanged.
  • Assertion documented: server_accepts_a_session now says why moq_session_close(client) == 0 holds.
  • Comment reworded: server_rejects_a_session no longer claims the client "sees it connect first".
  • Quest file deleted: the finished quest.

Pullfrog  | View workflow run | Using claude-sonnet-5-5 | 𝕏

@coderabbitai

coderabbitai Bot commented Nov 18, 2026

Copy link
Copy Markdown
Contributor

Explain Change →

No actionable comments were generated in the recent review.

Walkthrough

The change deletes an investigation note about intermittent session test failures. It revises or removes comments about session-close ordering, client state after server closure, and rejected session requests. No executable test logic or session-close assertions changed.

Merge Risk: Minimal · up to 1c0c1

This change only updates test comments and removes a finished investigation note. It does not alter library behavior, so there is no merge risk.

Pre-merge checks: Passed 4

Check name Status Explanation
Title check Passed The title names the test(libmoq) scope and the session-close flake fix by #9038, and it says the outdated comments were dropped. The PR removes outdated comments in libmoq tests and deletes the finish…
Description check Passed The description states the problem, the cause, the fix in #9038, the changed test comments, the validation runs, and the impact. It matches the comment-only changes to the quest file and the libmoq te…
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Full details: Title check

Explanation

The title names the test(libmoq) scope and the session-close flake fix by #9038, and it says the outdated comments were dropped. The PR removes outdated comments in libmoq tests and deletes the finished quest, so the title matches the change. It is long at 83 characters, but it is specific and not vague.

Full details: Description check

Explanation

The description states the problem, the cause, the fix in #9038, the changed test comments, the validation runs, and the impact. It matches the comment-only changes to the quest file and the libmoq tests.

Finishing Touches

Simplify code

  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

Recent review info

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Organization UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 0b7c74ff-de56-4916-992c-4652c50563c1
Commits

Reviewing files that changed from the base of the PR and between 38e9e05 and 1c0c161.

Files selected for processing: 3

  • quest/m0/test-flakes-3/c-server-accepts-session.md
  • rs/libmoq/src/test.rs
  • rs/libmoq/src/test/parity.rs
Files with no reviewable changes: 2

  • quest/m0/test-flakes-3/c-server-accepts-session.md
  • rs/libmoq/src/test/parity.rs

Included review availability: This review used your included allowance. Your plan provides up to 4 included reviews per hour; 2 remain after this review.

@kixelated
kixelated added this pull request to the merge queue Nov 18, 2026
Merged via the queue into main with commit 7c803f0 Nov 18, 2026
12 checks passed
@kixelated
kixelated deleted the quest/m0/test-flakes-3/c-server-accepts-session branch November 18, 2026 13:06
Sign up for free to 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.

1 participant