GeezerVison is showing github.com — lab-ops-hub: the #500 crawl-timeout fix has no regression test — crawlFallback's fetcher is inline in the untestable Worker entry · Issue #524 · developing-today/code
lab-ops-hub: the #500 crawl-timeout fix has no regression test — crawlFallback's fetcher is inline in the untestable Worker entry #524
Description
Problem
The #500 fix — a per-hop AbortSignal.timeout(20_000) on the Worker-fallback crawler — has no committed regression test. If the signal line is dropped, renamed, or the timeout raised, every test in the repo still passes.
Evidence (verified this run, main 1d0de449)
- The timeout lives inline in the fetcher passed to
fetchFollowingValidatedRedirects inside the unexported crawlFallback in pkgs/lab-ops-hub/src/index.ts:170-176 (signal: AbortSignal.timeout(20_000) at :174).
src/index.ts is the Worker entry point (wrangler.jsonc:4 "main": "src/index.ts", imports Cloudflare bindings at module scope) and no test imports it.
- The only TS suite,
test/lib.test.ts, imports exclusively from src/lib.ts (computeBudget, fetchFollowingValidatedRedirects, readResponseTextCapped, validateCrawlUrl, …) — the pure-helper pattern the sibling crawl fixes (lab-ops-hub: Worker-fallback crawler follows redirects to non-public targets (no redirect validation, unlike the container) #460/lab-ops-hub: Worker fallback crawler buffers the whole response body — no 2 MB cap like the container #481) deliberately used precisely so the behaviour is testable with plain Node.
- PR fix(lab-ops-hub): fetch timeout for the Worker-fallback crawler (#500) #501's verification was a manual behaviour probe only (stall aborts ~305 ms, slow-drip body read aborts ~301 ms at a 300 ms stand-in timeout) — sound, but nothing in
npm test (TS 20/20 + Python 16/16, re-run green this run) pins it.
Why it matters
#500 was a real hang: a validated public target that accepts the connection and stalls (or slow-drips a body under the 2 MB cap) hung the fallback crawl until platform limits killed it. The one line that prevents it is exactly the kind of line a future refactor of crawlFallback can silently lose — the fetcher is an anonymous inline arrow, so nothing about its shape signals "this signal is load-bearing".
Acceptance criteria
- Extract a testable fetcher factory in
src/lib.ts (e.g. crawlFetcher(timeoutMs, fetchImpl?) returning the (u) => fetch(u, { redirect: "manual", headers, signal }) function), and have crawlFallback in src/index.ts use it — same 20 s default, same headers, same manual-redirect mode.
- New tests in
test/lib.test.ts pin: (a) every call receives an AbortSignal; (b) a fetch whose response stalls rejects when the signal fires (short stand-in timeout); (c) a slow-drip body read through the returned response rejects on abort.
- Ablation: the new tests fail if the factory stops attaching the signal.
-
npm test in pkgs/lab-ops-hub stays green (TS + Python suites).
Single-repo: lab-ops-hub / crawlFallback exist only in this repo (grep-verified against the opencode, openchamber and nix clones). Filed by new-issue-creator from the pr-diff-review REVIEW-FINDING recorded against PR #501 on 2026-10-21.
Metadata
Metadata
Development
No branches or pull requestsIssue actions