Skip to content

test: synchronize load-sensitive checks on events and local state - #7717

Merged
kixelated merged 3 commits into
mainfrom
quest/m0/test-flakes-2/load-timing-bounds
Nov 3, 2026
Merged

kixelated merged 3 commits into
mainfrom
quest/m0/test-flakes-2/load-timing-bounds

Conversation

@kixelated

@kixelated kixelated commented Nov 3, 2026 •

Copy link
Copy Markdown
Collaborator

Problem

Completes the load-timing quest. Tests treated host scheduling, shared epoch pins, or a single stderr sample as evidence about the behavior under test.

Approach

  • C callbacks wait for delivery. The existing nextest watchdog still detects a hang; media delays, codec selection, callback lifetimes, and the broadcast-request helper are unchanged.
  • CLI replacement/fallback tests wait for their route events and retain all identity/media assertions. Origin tests already verify the update hold with simulated time.
  • Reclamation tests use a local epoch collector, including a case with an unrelated global pin. Remove the ineffective module-wide lock and share the collection helper.
  • Wait for the dispatcher's complete start line before terminating its active phase, preserving its existing hang guard and cleaning up on assertion failure.

Impact

  • Public API: none.
  • Wire: none.
  • Production behavior: unchanged. No production codec or routing timing defect was established or fixed.

Validation

  • Before/after diagnostics: an unrelated global epoch pin retained 21 references instead of 1 before isolation; the same schedule passes after it. All 15 log tests pass.
  • A scratch one-second starvation of the CLI test runtime fails the old 601 ms bound. All three real-relay protocol cases pass with event waits. Simulated origin tests retain the hold-timing contract.
  • A scratch gate on the dedicated C runtime delivers a callback at 10.1 seconds: the old callback helper fails, and the event wait passes. All eight raw-video cases pass. The originally reported loaded raw-video failure did not recur in the baseline; this establishes the callback scheduling assumption, not an additional production timing diagnosis.
  • A controlled delayed/fragmented stderr stream defeats the old nonblocking sample and passes the event wait. All 35 dispatcher tests pass. The historical host-load failure itself did not recur on current source.
  • quest gate just ci passed: 11,228 Rust tests, 35 dispatcher tests, tooling tests, and repository checks. quest check --base origin/main passed (600 documents).
  • Local review: Claude Code (claude-opus-5-5, medium effort), round 2, no findings.

Alternatives

Larger callback/routing deadlines still measure host load. Paused time conflicts with real sockets and codec threads. Keep the real integration paths, assert their events, and leave hold timing to the existing simulated tests.

Choices

Use event waits for the shared C status-callback fixture rather than adding a raw-video-only helper. Collector injection is private and compiled only in unit tests. Preserve the announcement and follow changes owned by moq-dev/moq#7678, and leave moq-dev/moq#7659's lifetime fixes separate.

Follow-ups

None established by this change.

Review

Claude Code (claude-opus-5-5, medium effort), round 2, head af3441d8db0cad28d7e2465d279f32f1352b58c6: no findings.

Round 1's partial UTF-8 diagnostic finding is fixed. Its C finding was refuted with the controlled runtime-starvation results above and source evidence: the cited remaining waits belong to separate lock-isolation/state/follow fixtures, outside video_raw_*. Round 2 accepted the response.

(Written by GPT-6.1 Sol)

kixelated and others added 2 commits November 3, 2026 02:06
@kixelated kixelated changed the title Timing-bound tests pass beside a busy build test: synchronize load-sensitive checks on events and local state Nov 3, 2026
Co-Authored-By: GPT-6.1 Sol <noreply@openai.com>
@kixelated
kixelated marked this pull request as ready for review November 3, 2026 10:22
@coderabbitai

coderabbitai Bot commented Nov 3, 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 9 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
  • 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: 748b1bc7-aedd-4346-a990-cc16bd7ce525
Commits

Reviewing files that changed from the base of the PR and between 801fd9a and af3441d.

Files selected for processing: 6
  • quest/m0/test-flakes-2/README.md
  • quest/m0/test-flakes-2/load-timing-bounds.md
  • rs/kio/src/log.rs
  • rs/moq-c/src/test.rs
  • rs/moq-cli/tests/integration/instances.rs
  • sh/dispatch-query.test.py
  • 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

CodeRabbit Verify

  • Run CodeRabbit Verify to test the changes in this pull request.

@kixelated kixelated left a comment

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Automated review by review (OpenAI)

Reviewed commit: af3441d

Isolating reclamation and waiting for actual route, callback and dispatch events avoids conflating host scheduling with correctness. Keeping hold timing in simulated tests is appropriate. No actionable bugs found in this static review. I did not run tests or load scenarios.

@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.

Reviewed changes — a test-only de-flake PR that completes the load-timing-bounds quest; no production API, wire, or behavior change.

  • Quest retired: load-timing-bounds.md deleted and its README entry removed; no dangling references remain.
  • kio reclamation isolation: Shared<T> gains a #[cfg(test)] local epoch::Collector behind a Shared::pin() helper, used by Writer::take_evicted, Writer::retire, and Reader::read; reclamation tests use an isolated() writer and a shared collect(&collector), replacing the ineffective module-wide COLLECTOR mutex. reader_outlives_writer deliberately keeps a global pin to prove independence.
  • moq-c callbacks: Callback::recv now blocks (self.rx.recv()) instead of using the 10s recv_timeout, deferring hang detection to the nextest watchdog (30s SLOW / 60s kill).
  • moq-cli routing tests: removed the wall-clock routing()/within() bound and await route events directly, keeping all identity/media assertions.
  • dispatch-query stderr: replaced the one-shot nonblocking sample with select.select + incremental os.read until the ci: check rs started line arrives, with terminate/drain in finally and safe partial-UTF-8 diagnostic decoding.

I verified the crossbeam-epoch 0.9.21 contract behind the one non-obvious change: LocalHandle::pin(&self) -> Guard is lifetime-free, and LocalHandle::drop (release_handle) does not finalize while a guard is held, so collector.register().pin() dropping the temporary handle is safe and the Local lives exactly as long as the Guard. I did not run the suites or load scenarios.

Pullfrog  | View workflow run | Using deepseek-v4.1-flash (free via Pullfrog for OSS) | 𝕏

@kixelated
kixelated added this pull request to the merge queue Nov 3, 2026
Merged via the queue into main with commit a7905b5 Nov 3, 2026
11 checks passed
@kixelated
kixelated deleted the quest/m0/test-flakes-2/load-timing-bounds branch November 3, 2026 16:14
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