Skip to content

test: speed up integration tests with channel notification and parallel execution#828

Merged
ryanfowler merged 2 commits into
mainfrom
test/speed-and-reliability
Jul 2, 2026
Merged

test: speed up integration tests with channel notification and parallel execution#828
ryanfowler merged 2 commits into
mainfrom
test/speed-and-reliability

Conversation

@ryanfowler

Copy link
Copy Markdown
Owner

Summary

Replaces polling loops in the integration test infrastructure with mpsc channel notification, removes the --test-threads=1 sequential-execution constraint, and reduces several artificial delays and timeouts. Full suite wall clock went from ~48s → ~11s (4.4× faster).

Changes

  • Channel notificationTestServer and H3TestServer now send a notification per request via mpsc channel; wait_for_requests/`wait_for_h3_requestsblock onrecv_timeout` instead of polling every 10ms
  • Parallel execution — Removed --test-threads=1 from CI command. All test servers bind to 127.0.0.1:0 (random ports), DNS servers use random UDP ports, and HTTP/3 caches are isolated per process — safe to run in parallel
  • Reduced artificial delays — DNS AAAA 4s→1s, H3 body 100ms→50ms, H2 accept 250ms→100ms, stalling proxy 5s→3s
  • Reduced timeoutsrun_fetch_once 30s→15s, wait_child 5s→3s (×4 PTY helpers), accept_tcp_connection 5s→3s, signal test 5s→3s, PartialBodyReplayServer 10s→5s
  • Documentation — AGENTS.md updated with parallel safety notes and channel notification documentation

Validation

  • 956 tests pass (831 unit + 125 integration)
  • cargo fmt --check clean
  • cargo clippy --locked --all-targets --all-features -- -D warnings clean
  • Full suite wall clock: ~48s → ~11s

…el execution

- Replace polling loops in TestServer/H3TestServer with mpsc channel notification
  for instant wakeup on request arrival (wait_for_requests, wait_for_h3_requests)
- Remove --test-threads=1 from CI command — all test servers use random ports
  and HTTP/3 caches are isolated per run, so parallel execution is safe
- Reduce artificial delays: DNS AAAA 4s->1s, H3 body 100ms->50ms,
  H2 accept 250ms->100ms, stalling proxy 5s->3s
- Reduce timeouts: run_fetch_once 30s->15s, wait_child 5s->3s,
  accept_tcp_connection 5s->3s, PartialBodyReplayServer 10s->5s
- Update AGENTS.md with parallel safety notes and channel notification docs

Full suite wall clock: ~48s -> ~11s (4.4x faster)
ETXTBUSY (errno 26) occurs when trying to exec a file that is still open
for writing — a transient condition that can happen when a temp script
is written and immediately executed (antivirus scanners, delayed writes).
Retry up to 5 times with exponential backoff (10-160ms).
@ryanfowler ryanfowler merged commit fda1ff8 into main Jul 2, 2026
4 checks passed
@ryanfowler ryanfowler deleted the test/speed-and-reliability branch July 2, 2026 05:50
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.

1 participant