Skip to content

fix(moq-c): hold the wait so the end-gap follow test sees the gap - #5886

Merged
kixelated merged 1 commit into
mainfrom
fix/moq-c-announced-flake
Oct 17, 2026
Merged

kixelated merged 1 commit into
mainfrom
fix/moq-c-announced-flake

Conversation

@kixelated

Copy link
Copy Markdown
Collaborator

Fixes a flake from #5700: test::consume_announced_delivers_the_instance_again_after_an_end timed out on its second delivery about one run in six.

Root cause

The test, not the follow loop. The C wait follows on its own task, so it can take the route above the path ("", same epoch) and run dry before the test unannounces live. The Follow cursor then knows that route stood before the path's own route left, which proves no gap, so it reports an Update. The instance rides on through the front, and correctly is not delivered again. Instrumenting apply showed exactly that in every failing run: Start(live) then Update(""), no End. The test only gets the End then Start it is about when both changes are on hand when the wait next looks.

Fix

A gated callback holds the wait inside its first delivery (the C runtime is one current-thread runtime, so nothing follows meanwhile) while the test adds the route above and unannounces the path, then releases it. Both changes are on hand together, so the cursor reports the gap every run. The test still fails when the follow loop's End handling is removed.

The moq-ffi twin, announced_broadcast_hands_out_the_instance_again_after_an_end, has no such race: it makes both changes between available() calls, when nothing is following.

Loops

Run directly from the test binary, 4 at a time:

  • Before: 5 and 10 failures of 30 for the flaky test; its siblings 0 of 30.
  • After: all six moq-c follow tests (*_the_instance_again_after_an_end, *_gap_while_resolving_once, *_freed_takeover_again, *_held_takeover_once, *_takeover_once_while_resolving, consume_announced_follows_a_restart): 0 failures of 200 each.
  • The seven moq-ffi follow tests: 0 failures of 50 each, unchanged.

just check passes.

Public API and wire impact

None: test-only.

(Written by Claude Opus 5.5)

🤖 Generated with Claude Code

consume_announced_delivers_the_instance_again_after_an_end flaked about one
run in six. The C wait follows on its own task, so it could take the route
above the path before the test unannounced the path. The cursor then knew
that route stood before the path's own route left, which is no gap, and
reported an update: the instance rides on and correctly is not delivered
again. The test timed out waiting for a delivery it never earned.

Hold the wait inside its first delivery until both changes are made, so
they are on hand together and the cursor reports the end and the start the
test is about. The follow loop is unchanged; the moq-ffi twin already makes
both changes between available() calls, when nothing is following.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@coderabbitai

coderabbitai Bot commented Oct 17, 2026

Copy link
Copy Markdown
Contributor

Warning

Review limit reached

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Next included review available in 7 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used all 4 included reviews currently available.

Learn how review limits work.

Review configuration:

⚙️ Run configuration
  • Configuration used: Organization UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: ef73dc86-0650-4d62-8de9-9223393faab5
📥 Commits

Reviewing files that changed from the base of the PR and between 1485b06 and 02b8648.

📒 Files selected for processing: 1
  • rs/moq-c/src/test.rs
  • 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

Comment @coderabbitai help to get the list of available commands.

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 17, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-17T20:25:04.766630Z 02b8648 PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@kixelated
kixelated added this pull request to the merge queue Oct 17, 2026
Merged via the queue into main with commit 164509c Oct 17, 2026
8 checks passed
@kixelated
kixelated deleted the fix/moq-c-announced-flake branch October 17, 2026 20:54
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