You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
test(web-search): isolate sticky selection from the header-timeout fixture - #9070
Use the normal header deadline for the web-search test that checks whether a late body timeout leaves the primary target's sticky success allowance intact. Its 120 ms body deadline, 2 s per-request guard, and required target order stay in place. Assert the second request's recorded provider and HTTP status before checking its response text so the next failure distinguishes initial selection from failover. The dedicated header deadline tests keep their 30 ms setting.
Verification
On Windows with Bun 1.4.4, all 29 tests in tests/web-search/web-search-local-deadline-provenance.test.ts passed (160 assertions).
In an isolated comparison, the original test passed normally. Giving the healthy second primary response a 60 ms header delay made the original fixture record primary 504 followed by backup 200. With this patch, the same mock recorded primary 200, and the next request went to backup as expected. The committed test has no artificial delay or global clock changes.
The failed check on #9068 ended with backup output on the second request. That run did not record its attempt sequence in the failure, so its precise cause is unconfirmed.
The repository typecheck (bun check --no-script --noEmit) passed for 2,691 source files. A separate strict check including the test file had the same four pre-existing diagnostics at the timer spy in both revisions and none in the new assertion.
Local validation focused on the affected test file. All requests used synthetic providers and an in-process transport. The full repository suite was not run locally.
Checklist
Scoped the change to one test fixture and its assertions.
The fixture still checks the visible prefix, timeout provenance, absence of target cooldown, and the primary → primary → backup sequence.
Reviewed the added diagnostics. They compare fixture provider names and HTTP statuses.
Summary by CodeRabbit
Tests
Updated coverage for backup body-stall deadline scenarios.
Added checks that the next request continues using the primary target and returns its response.
Reviewing files that changed from the base of the PR and between 85074e6 and b4c36c0.
You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.
Use the checkbox below for a quick retry:
Trigger review
No actionable comments were generated in the recent review.
Walkthrough
The deadline provenance test adjusts its backup body-stall fixture and verifies that the request after a sticky body deadline uses the primary target and returns “primary answered.”
Changes: Deadline provenance test
Layer / File(s)
Summary
Configure and verify sticky body deadlines tests/web-search/web-search-local-deadline-provenance.test.ts
The fixture omits connectTimeoutMs for backup body stalls while retaining HEADER_MS for other cases. The sticky deadline test checks that the next request records only a successful primary attempt and returns “primary answered.”
This change only updates a test fixture and its assertions, so it does not alter product behavior. No actionable merge risk was found.
Pre-merge checks: 4
Check name
Status
Explanation
Description Check
Check skipped - CodeRabbit’s high-level summary is enabled.
Title check
The title names the test scope (web-search) and the main change: the sticky-selection test now uses a fixture without the header timeout, isolating sticky selection from the header-timeout behavior. T…
Linked Issues check
Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check
Check skipped because no linked issues were found for this pull request.
Full details: Title check
Explanation
The title names the test scope (web-search) and the main change: the sticky-selection test now uses a fixture without the header timeout, isolating sticky selection from the header-timeout behavior. The summary and objectives confirm the fixture change for the sticky body-deadline test, so the title is specific and related to the main change.
Finishing Touches
Generate unit tests (beta)
Create a new PR
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.
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 6 remain after this review.
PR checks passing on that head: enforce / enforce-target, ci, test changed, storage policy, api usage, gates, hygiene / hygiene, enforce / resolve-pr, changes, select windows runner, label / label. Skipped jobs are not counted as passing.
Relaxed gate: (a) 3 commits behind origin/dev 3ec89d2 (limit 10): PASS. (b) git merge-tree --write-tree 3ec89d2b4c36c0: clean. (c) dev commits since merge-base 8961476 touch none of this PR's files: yes; shared-class files dev touched: scripts/test-layout/layout-server-inbound.json tests/fixtures/test-layout-expected.json ; shared-class files this PR touches: none (guards below decide when both sides touch a class). (d) temporary local merge b5fe695a3c2dff664ac0c1d1726deb0145747e0a: bun run typecheck exit 0; bun test --timeout 60000 [focused: tests/web-search/web-search-local-deadline-provenance.test.ts] [guards: tests/test-layout.test.ts tests/test-layout-tooling.test.ts tests/ci-workflows/file-size-ratchet.test.ts tests/ci-workflows/skill-ocx.test.ts]: 82 pass 0 fail exit 0; bun run structure:check exit 0: PASS.
Independent review (gpt-6.1-terra): APPROVE, no findings. The change keeps the body-timeout, cooldown and primary/primary/backup assertions and adds an attempt-level provider/status assertion; the header-deadline cases keep their 30 ms deadline. This is the flake that failed perf(m365): reuse parsed tool ranges in completed answers #9068's test changed.
scripts/ci/assert-mergeable-review.sh --maintainer-integration 9070: OK.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
choreMaintenance, CI, tests, refactors, or build changes (not a user-facing bug or feature).
2 participants
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Use the normal header deadline for the web-search test that checks whether a late body timeout leaves the primary target's sticky success allowance intact. Its 120 ms body deadline, 2 s per-request guard, and required target order stay in place. Assert the second request's recorded provider and HTTP status before checking its response text so the next failure distinguishes initial selection from failover. The dedicated header deadline tests keep their 30 ms setting.
Verification
tests/web-search/web-search-local-deadline-provenance.test.tspassed (160 assertions).bun check --no-script --noEmit) passed for 2,691 source files. A separate strict check including the test file had the same four pre-existing diagnostics at the timer spy in both revisions and none in the new assertion.Checklist
Summary by CodeRabbit