Skip to content

fix(tests): reject polling results after the deadline - #443

Merged
Mathih13 merged 1 commit into
mainfrom
fix/polling-deadline
Sep 7, 2026
Merged

Mathih13 merged 1 commit into
mainfrom
fix/polling-deadline

Conversation

@Mathih13

@Mathih13 Mathih13 commented Sep 7, 2026 •

Copy link
Copy Markdown
Contributor

The durable test polling function could accept success after its timeout. It could also start another check after the budget had expired. CodeRabbit identified this during review of #419.

Check the deadline before and after each synchronous check, and limit sleep to the remaining time. The function documents that it cannot interrupt a blocked callback.

Three regression tests cover immediate success, late success, and an expired budget. They run in the normal Gateway unit test suite. The old implementation failed both deadline cases; all three pass with this change. Targeted formatting and diff checks pass.

This PR includes the fixture correction from merged #442 and now targets main. Changing the base preserved the source tree under test. The review diff contains only the polling change.

Implemented and reviewed with GPT-5.6 and GPT-6 in Codex.

@coderabbitai

coderabbitai Bot commented Sep 7, 2026 •

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Advanced

Run ID: ea28a88e-8ab0-48ce-b97d-c8431b0d1a9b

📥 Commits

Reviewing files that changed from the base of the PR and between c5ef477 and f172fef.

📒 Files selected for processing (1)
  • module/tests/support/mod.rs

Included review availability: Your plan provides up to 10 included reviews per hour; 6 remain after this review.


📝 Walkthrough

Walkthrough

poll_until now checks the deadline before and after each probe. It rejects results that arrive after expiration, limits sleep to the remaining budget, and adds tests for success and expired-budget behavior.

Changes

Polling timeout enforcement

Layer / File(s) Summary
Deadline enforcement and validation
module/tests/support/mod.rs
poll_until checks the deadline before probing and after probe completion. It limits sleep to the remaining budget. Tests cover immediate success, late success, and avoiding probes after expiration.

Estimated code review effort: 2 (Simple) | ~10 minutes

Merge Risk: ⚪ Minimal · up to f172f

Polling now honors its timeout budget by avoiding expired probes and rejecting results that arrive too late. The intended timeout behavior is covered without an active merge-blocking risk.

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 6 functions across 1 files.
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.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and concisely describes the main change: rejecting polling results that complete after the deadline.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/polling-deadline

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

@Mathih13

Mathih13 commented Sep 7, 2026

Copy link
Copy Markdown
Contributor Author

@coderabbitai review

@coderabbitai

coderabbitai Bot commented Sep 7, 2026 •

Copy link
Copy Markdown
✅ Action performed

Review finished.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@Mathih13
Mathih13 changed the base branch from fix/scripted-noop-fixture-regeneration to main September 7, 2026 08:36
@Mathih13
Mathih13 merged commit ea56e0b into main Sep 7, 2026
7 checks passed
@Mathih13
Mathih13 deleted the fix/polling-deadline branch October 11, 2026 18:20
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