Skip to content

test: make the client concurrency tests deterministic - #411

Merged
devopvoid merged 1 commit into
mainfrom
test/deterministic-concurrency
Oct 22, 2026
Merged

devopvoid merged 1 commit into
mainfrom
test/deterministic-concurrency

Conversation

@devopvoid

Copy link
Copy Markdown
Owner

The client API's race tests relied on sleeps, racing timeouts and repeated attempts. They now decide the interleaving themselves:

  • WebRtc.Builder takes a control pool and a timer through package-private methods; tests pass a ManualExecutor and a ManualTimer and step through tasks and timeouts.
  • createPeer is split into register and open, the points where a closing runtime can meet it.
  • New tests cover SerialExecutor rejection, createPeer against close at each point, WHIP/WHEP answers that arrive after the session timed out, and how close failures are reported.
  • TestHttpEndpoint holds answers on a latch instead of sleeping.

The runtime takes a control pool and a timer through package-private
builder methods, so tests step through control tasks and fire timeouts
themselves. createPeer is split into register and open, the points a
closing runtime can meet it at. New tests cover SerialExecutor rejection,
createPeer against close at each point, answers that arrive after the
session timed out, and how close failures are reported; the HTTP test
endpoint holds answers on a latch instead of sleeping.
@devopvoid
devopvoid merged commit 6d8d8de into main Oct 22, 2026
36 of 37 checks passed
@devopvoid
devopvoid deleted the test/deterministic-concurrency branch October 22, 2026 16:23
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