perf(test): eliminate two more real-wait retry-backoff hotspots - #8573
Conversation
fetchReesPingWithRetry (REES /v1/ping 503 retry) and netuid-verification's fetchWithRetry both paid their real production backoff delay in tests that exercise the retry path, adding ~4s of pure wall-clock wait across the affected suites. Add the same settable-override pattern already used for the other suite-wide retry delays, defaulting to the real production value and only overridden to 0 in test/helpers/vitest-setup.ts. Also switch the two probeReesSecretAtStartup regression tests off a fixed 1100ms sleep-then-assert (needed because the probe is fire-and-forget) onto vi.waitFor, so they settle as soon as the now-fast retries actually finish instead of always paying the old worst-case wait.
|
Superagent didn't find any vulnerabilities or security issues in this PR. |
Logic backtestReplayed 0 historical case(s) for Backtest comparison:
|
retryPoolQuery's real 500ms-multiplier backoff ran for real in the three PG connection-resilience tests in selfhost-pg-queue.test.ts (only Date was faked, not setTimeout) -- ~6.5s of pure wall-clock wait across those three tests alone. Add the same settable-override pattern used elsewhere in this file's fixtures, scoped to this test file only (not the global vitest-setup default) since pg-queue.ts isn't otherwise imported broadly across the suite. Production default and behavior unchanged.
Codecov Report❌ Patch coverage is
❌ Your patch status has failed because the patch coverage (71.42%) is below the target coverage (99.00%). You can increase the patch coverage or adjust the target coverage. Additional details and impacted files@@ Coverage Diff @@
## main #8573 +/- ##
==========================================
- Coverage 92.54% 92.54% -0.01%
==========================================
Files 796 796
Lines 79845 79850 +5
Branches 24134 24135 +1
==========================================
- Hits 73896 73895 -1
Misses 4802 4802
- Partials 1147 1153 +6
Flags with carried forward coverage won't be shown. Click here to find out more.
|
Summary
fetchReesPingWithRetry(REES/v1/ping503-retry) and content-lanenetuid-verification.ts'sfetchWithRetryboth paid their real production backoff delay in tests exercising the retry path — ~4s of pure wall-clock wait combined.review-files-empty, GitHub rate-limit sleep cap, merge-state-unknown retry) — production default unchanged, only zeroed viatest/helpers/vitest-setup.ts.probeReesSecretAtStartupregression tests previously slept a fixed 1100ms before asserting (needed since the probe is fire-and-forget); switched tovi.waitForso they settle as soon as the now-fast retries actually finish.Follow-up to the test-suite speed work in #8548, #8550, #8553.
Test plan
npx vitest run test/unit/enrichment-wire.test.ts test/unit/content-lane-netuid-verification.test.ts test/unit/miner-ci-poller-failure-modes.test.ts test/unit/miner-http-retry.test.ts test/unit/miner-pr-disposition-poller.test.ts— 133 passed in ~1.2s (previously included ~4s of real sleeps)npm run typecheck— clean