Watch
0
0
Fork
You've already forked hyperhive
0

swarm-controller: let each test nats-server bind its own port

TestNats picked a port by binding 127.0.0.1:0, dropping the listener
and handing the number to nats-server. Until that server bound it, the
port was free for a concurrent test's bind(0) to return again. Both
servers were then started on it (with the same store dir, since that was
keyed by pid and port); the loser exited silently and both tests'
clients reached the winner. term_stream's tests all use the stream
term-main-iris, and one of them creates it with max_message_size 4096,
so a test sharing its server got "stream name already in use with a
different configuration" (10058) from open_or_create's
get-then-create.

The server now binds a port of its choice (-p -1) and announces it in a
ports file, and each server has its own tempdir for the store and that
file, so a test can only reach the server it started.

Fixes #5261
This commit is contained in:
atlas 2026-10-14 16:27:16 +02:00
commit 41404598f5
3 changed files with 58 additions and 21 deletions

1
Cargo.lock generated
View file

@ -4880,6 +4880,7 @@ dependencies = [
"swarm-matrix-client",
"swarm-queue-client",
"swarm-secret-client",
"tempfile",
"tokio",
"tower",
"tracing",