Repository navigation
test(refresh): cap fetcher retries in the network timeout test - #524
Merged
Merged
Conversation
The timeout test shortened the fetcher timeout to 500ms but kept the default retry policy (3 retries, 1s base backoff), so the stalled page cost about 9s of retries and backoff. Alone the test took ~15s against a 15s budget, and it timed out in loaded full runs. Allow one retry with a 10ms backoff instead. The test still drives a real timeout followed by a retry, and now asserts that both attempts reached the stalled page, so the page is dropped by the timeout and not by another gate. The test now runs in ~2.5s alone.
There was a problem hiding this comment.
Copilot review overview
🟢 Approval recommended
The focused test-only change preserves behavioral coverage while removing unnecessary runtime.
Review effort: Balanced
Findings: None
What changed in this PR
This PR stabilizes the refresh pipeline timeout test by reducing retry delays while preserving timeout-and-retry coverage.
Changes:
- Limits the test to one retry with a 10 ms backoff.
- Counts and verifies both timed-out requests.
- Retains existing indexing and search assertions.
| File | Description |
|---|---|
test/refresh-pipeline-e2e.test.ts |
Caps retry latency and verifies two timeout attempts. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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
The test "should handle network timeouts gracefully and continue processing other pages" in
test/refresh-pipeline-e2e.test.tsset the fetcher timeout to 500 ms but kept the default retry settings: 3 retries with a 1 s backoff. Because the/timeout-pagemock is persisted, every retry stalls too. That made the stalled page cost about 9 s. Run alone, the test took ~15 s against its 15 s limit, and it timed out in loaded fullnpm testruns.Change
The change is limited to this one test:
scraper.fetcher.maxRetries = 1) with a 10 ms backoff (scraper.fetcher.baseDelayMs = 10). The test still goes through a real timeout, a retry, and a second timeout./timeout-pagemock now counts its requests, and the test checks the count is 2. This shows the page was dropped because it timed out, not because some other filter skipped it./,/page1and/page2are, and their content is searchable.Verification
test/refresh-pipeline-e2e.test.tsfile passes (12/12).npm run typecheckpasses from a clean cache.