Skip to content

test(refresh): cap fetcher retries in the network timeout test - #524

Merged
arabold merged 1 commit into
mainfrom
test/refresh-timeout-retries
Oct 4, 2026
Merged

arabold merged 1 commit into
mainfrom
test/refresh-timeout-retries

Conversation

@arabold

@arabold arabold commented Oct 4, 2026

Copy link
Copy Markdown
Owner

Summary

The test "should handle network timeouts gracefully and continue processing other pages" in test/refresh-pipeline-e2e.test.ts set the fetcher timeout to 500 ms but kept the default retry settings: 3 retries with a 1 s backoff. Because the /timeout-page mock 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 full npm test runs.

Change

The change is limited to this one test:

  • Allow one retry (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.
  • The /timeout-page mock 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.
  • The existing checks are unchanged: the stalled page is not indexed, /, /page1 and /page2 are, and their content is searchable.

Verification

  • Alone (Node 22): 2.4–2.7 s per run, down from ~15 s. In a traced run, about 1.4 s is the cold start on the first page and about 1 s is the two 500 ms timeouts. No other waiting showed up.
  • The whole test/refresh-pipeline-e2e.test.ts file passes (12/12).
  • npm run typecheck passes from a clean cache.

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.
Copilot AI balanced review requested due to automatic review settings October 4, 2026 23:31

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@arabold
arabold merged commit fe4cc57 into main Oct 4, 2026
3 checks passed
@arabold
arabold deleted the test/refresh-timeout-retries branch October 4, 2026 23:33
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.

2 participants