tests/speed.test.ts — 22 lines, 2 tests. Latency budget for the registry-tier domain lookup.
What it covers
getDomainFromRegistry('5569810061')returns'pontan.se'if a row exists for that org_nr (the test guards withif (domains.length > 0)so it passes whether seeded or not — it only asserts when data is present)- The same call must complete in < 50 ms (
Date.now() - start)
Caveats
Warning
The 50 ms budget is wall-clock, not pure DB time. On a cold connection, JIT, or noisy CI the test will flake. There is no
expect.skip()for unseeded environments — only the assertion in theifblock becomes a no-op when the domain row is absent.
What is not tested
- Cold-cache vs warm-cache behaviour
- Query plan (no
EXPLAIN ANALYZEassertion) - Other latency budgets in the Pipeline (Scrape_Job gating, Enrich_Job, Update_Job)
- Concurrent-load behaviour (P1 in Known Issues — Playwright in-worker concern is untested)
See also
Test Strategy, Domain Discovery, Domain Discovery Tests.