Skip to content

test(web-search): verify rotation deadline ownership deterministically - #3752

Merged
lidge-jun merged 2 commits into
devfrom
codex/release-244-deadline-fixture-07c0
Sep 6, 2026
Merged

test(web-search): verify rotation deadline ownership deterministically#3752
lidge-jun merged 2 commits into
devfrom
codex/release-244-deadline-fixture-07c0

Conversation

@lidge-jun

@lidge-jun lidge-jun commented Sep 6, 2026

Copy link
Copy Markdown
Owner

Summary

  • Replace a host wall-clock assertion in the never-settling 429 cancellation fixture with direct deadline-ownership and event-order checks.
  • Hold cancellation pending, queue controlled expiry at the next timer task, and require the rotated fetch to start first under the same unexpired signal. Assert one deadline, one rotated fetch, exact 504 response and cleanup; preserve the existing 1000ms test limit and real-timer tests.
  • Production web-search code, configured timeouts and retry policy are unchanged. This prerequisite repairs the macOS validation failure encountered by fix(kiro): coalesce adjacent outputs without losing tool identity #3750 and lands before that Kiro layer.

Verification

Checklist

  • Scope stays focused and avoids unrelated cleanup.
  • Docs or release notes were updated when needed.
  • Security-sensitive changes were reviewed for secrets, auth, and unsafe defaults.

Maintainer integration: the repository owner explicitly authorized admin integration without a second approval. This test-only layer changes no authentication, permissions, production timeout or cancellation policy.

Summary by CodeRabbit

  • Bug Fixes
    • Improved the web search timeout contract test to use deterministic timing, reducing failures caused by host scheduling and preparation delays.
    • Added coverage for deadline creation, cancellation, rotation, expiry ordering, cleanup, and the expected 504 response.
  • Tests
    • Preserved coverage for real-timer header timeouts and abort behavior while strengthening cleanup and timeout handling in the updated fixture.

@coderabbitai

coderabbitai Bot commented Sep 6, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

Caution

Review failed

The pull request is closed.

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Team

Run ID: 117d2edb-cdb3-4277-b1cf-5bf9eda9a9e3

📥 Commits

Reviewing files that changed from the base of the PR and between 00d0cc1 and efef9f0.

📒 Files selected for processing (2)
  • devlog/_plan/260906_release_244_followups/033_web_search_deadline_fixture.md
  • tests/web-search/web-search-timeout-contract.test.ts

📝 Walkthrough

Walkthrough

The change adds a deterministic deadline fixture to the web search timeout contract test. It controls cancellation and expiry ordering, replaces elapsed-time assertions, verifies cleanup and signal state, and preserves the exact 504 response. A planning document records the fixture repair requirements.

Changes

Web search timeout contract

Layer / File(s) Summary
Controlled deadline and cancellation fixture
tests/web-search/web-search-timeout-contract.test.ts, devlog/_plan/260906_release_244_followups/033_web_search_deadline_fixture.md
The test imports spyOn and abortModule, installs per-test cleanup, and mocks clearableDeadline with controlled expiry and cancellation resources. The 429 body records cancellation, queues deadline expiry, and returns a gated promise. The planning document records the same fixture requirements.
Rotation and response assertions
tests/web-search/web-search-timeout-contract.test.ts
The rotated fetch verifies signal identity and pending cancellation. Final assertions verify call counts, event ordering, deadline cleanup, timeout reason, and the exact 504 upstream_error JSON response. Cleanup runs in finally.

Estimated code review effort: 3 (Moderate) | ~20 minutes

✨ 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 codex/release-244-deadline-fixture-07c0

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.

@github-actions

github-actions Bot commented Sep 6, 2026

Copy link
Copy Markdown
Contributor

Deterministic PR hygiene checks passed.

@github-actions github-actions Bot added the chore Maintenance, CI, tests, refactors, or build changes (not a user-facing bug or feature). label Sep 6, 2026
@lidge-jun
lidge-jun marked this pull request as ready for review September 6, 2026 06:54
@lidge-jun
lidge-jun requested a review from Ingwannu as a code owner September 6, 2026 06:54
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Sep 6, 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-09-06T06:56:26.217565Z efef9f0 Draft marked ready
ℹ️ 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.

@lidge-jun
lidge-jun merged commit b3acb5d into dev Sep 6, 2026
29 of 31 checks passed
@lidge-jun
lidge-jun deleted the codex/release-244-deadline-fixture-07c0 branch September 6, 2026 06:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

chore Maintenance, CI, tests, refactors, or build changes (not a user-facing bug or feature).

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant