Skip to content

perf(test): eliminate two more real-wait retry-backoff hotspots - #8573

Merged
JSONbored merged 2 commits into
mainfrom
perf/test-suite-real-delay-hotspots-round2
Jul 24, 2026
Merged

perf(test): eliminate two more real-wait retry-backoff hotspots#8573
JSONbored merged 2 commits into
mainfrom
perf/test-suite-real-delay-hotspots-round2

Conversation

@JSONbored

Copy link
Copy Markdown
Owner

Summary

  • fetchReesPingWithRetry (REES /v1/ping 503-retry) and content-lane netuid-verification.ts's fetchWithRetry both paid their real production backoff delay in tests exercising the retry path — ~4s of pure wall-clock wait combined.
  • Adds the same settable-override pattern already used for the other suite-wide retry delays (review-files-empty, GitHub rate-limit sleep cap, merge-state-unknown retry) — production default unchanged, only zeroed via test/helpers/vitest-setup.ts.
  • The two probeReesSecretAtStartup regression tests previously slept a fixed 1100ms before asserting (needed since the probe is fire-and-forget); switched to vi.waitFor so 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

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-security

Copy link
Copy Markdown
Contributor

Superagent didn't find any vulnerabilities or security issues in this PR.

@github-actions

github-actions Bot commented Jul 24, 2026

Copy link
Copy Markdown
Contributor

Logic backtest

Replayed 0 historical case(s) for linked_issue_scope_mismatch through the base (346c183) and head (d5dd1cc) versions of its detection logic (corpus checksum 4f53cda18c2b).

Backtest comparison: linked_issue_scope_mismatch

Verdict: unchanged — no comparable axis moved.

Advisory only — this check never blocks merge (#8105).

@JSONbored JSONbored self-assigned this Jul 24, 2026
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

codecov Bot commented Jul 24, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 71.42857% with 2 lines in your changes missing coverage. Please review.
✅ Project coverage is 92.54%. Comparing base (346c183) to head (d5dd1cc).
⚠️ Report is 2 commits behind head on main.
✅ All tests successful. No failed tests found.

Files with missing lines Patch % Lines
src/review/content-lane/netuid-verification.ts 66.66% 0 Missing and 1 partial ⚠️
src/review/enrichment-wire.ts 75.00% 0 Missing and 1 partial ⚠️

❌ 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     
Flag Coverage Δ
backend 93.71% <71.42%> (-0.01%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

Files with missing lines Coverage Δ
src/review/content-lane/netuid-verification.ts 98.38% <66.66%> (-1.62%) ⬇️
src/review/enrichment-wire.ts 97.98% <75.00%> (-0.48%) ⬇️

... and 1 file with indirect coverage changes

@JSONbored
JSONbored merged commit a4a5013 into main Jul 24, 2026
8 of 9 checks passed
@JSONbored
JSONbored deleted the perf/test-suite-real-delay-hotspots-round2 branch July 24, 2026 22:16
@loopover-orb loopover-orb Bot added the gittensor:bug Gittensor-scored bug fix — scores a 0.05x multiplier. label Jul 24, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

gittensor:bug Gittensor-scored bug fix — scores a 0.05x multiplier.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant