Skip to content

Stop the throwing-read poll test from failing on a busy machine - #439

Merged
kblok merged 2 commits into
mainfrom
fix-expect-poll-flaky
Oct 18, 2026
Merged

kblok merged 2 commits into
mainfrom
fix-expect-poll-flaky

Conversation

@kblok

@kblok kblok commented Oct 18, 2026 •

Copy link
Copy Markdown
Member

The test Keeps_polling_through_a_throwing_read_and_reports_its_error_at_the_deadline failed now and then in CI. Its read awaited Task.Yield() before it threw. When the thread pool was busy, the stepping clock moved on before that continuation ran. The read's own timeout fired first, and the poll said "no read completed" instead of showing the read's error. The read now fails at once, like upstream's async throw, so the test no longer depends on thread timing. The product code is correct. Accepts_an_asynchronous_read in the same file also awaits Task.Yield() under the stepping clock and can flake the same way. I left it alone here.

🤖 Generated with Claude Code

https://claude.ai/code/session_01KWUdrjfarTEM4dmBbK6GaV

Summary by CodeRabbit

  • Tests
    • Updated automated coverage for repeated polling failures to check an asynchronous operation that is already faulted. This clarifies the failure scenario being tested and helps ensure the tests accurately verify polling behavior. No user-facing product behavior changed.

kblok and others added 2 commits October 18, 2026 10:07
The test's read yielded to the thread pool before it threw. On a busy pool the
stepping clock could fire the read's own timeout first, so the poll reported
'no read completed' instead of the read's error. The read now fails at once,
as upstream's async throw does.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01KWUdrjfarTEM4dmBbK6GaV
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01KWUdrjfarTEM4dmBbK6GaV
@coderabbitai

coderabbitai Bot commented Oct 18, 2026 •

Copy link
Copy Markdown

Review in Change Stack →

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration
  • Configuration used: Repository UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 73075300-aaac-4596-ac83-eb5bd6c10b42
📥 Commits

Reviewing files that changed from the base of the PR and between 895cd89 and cc94005.

📒 Files selected for processing: 1
  • tests/E2E.Tests/ExpectPoll/ExpectPollTests.cs

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

📝 Walkthrough

The poll failure test now returns an already-faulted task from its read operation. A comment explains the setup and its interaction with the stepping clock.

Changes: Poll failure test

Layer / File(s) Summary
Faulted read setup
tests/E2E.Tests/ExpectPoll/ExpectPollTests.cs
The read operation returns a faulted task containing the same InvalidOperationException. A comment documents the setup and warns against awaiting before returning the task.

Priority: ⬇️ Low

Estimated code review effort: 1 (Trivial) | ~5 minutes

Change: Other

Merge Risk: ⚪ Minimal · up to cc940

The change removes the yield from the targeted deadline test while preserving its failure assertions. No actionable merge risk introduced by this change was established.

Pre-merge checks: Passed 4 · Failed 1

Failed Failed checks: 1 warning

Check name Status Explanation Resolution
Docstring Coverage Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 1 functions across 1 files. Write docstrings for the functions missing them to satisfy the coverage threshold.
Passed Passed checks: 4 passed
Check name Status Explanation
Description Check Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check Passed The title clearly and concisely describes the main change: preventing the throwing-read poll test from failing because of busy-machine timing.
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.
  • Fix all pre-merge checks with AI
✨ Finishing Touches: 💡 1
📝 Generate docstrings: 💡
  • Commit to this branch
  • Create a new PR
🧪 Generate unit tests (beta)
  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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

@kblok
kblok merged commit d0d61ce into main Oct 18, 2026
2 checks passed
@kblok
kblok deleted the fix-expect-poll-flaky branch October 18, 2026 14:49
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