Commit b068c07
committed
Use deterministic port allocation in integration tests
Replace the bind-to-port-0-then-drop pattern in test port allocation
with an atomic counter starting at port 20000. The previous approach
had a TOCTOU race: the OS-assigned port was released when the probe
socket was dropped, allowing another test's node to grab it before
Node::start() could re-bind, causing sporadic InvalidSocketAddress
failures in CI.
An atomic counter guarantees unique ports across all parallel tests
within the process and is stable across node restarts.
AI tools were used in preparing this commit.1 parent a555133 commit b068c07
1 file changed
+8
-10
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
14 | 14 | | |
15 | 15 | | |
16 | 16 | | |
| 17 | + | |
17 | 18 | | |
18 | 19 | | |
19 | 20 | | |
| |||
268 | 269 | | |
269 | 270 | | |
270 | 271 | | |
271 | | - | |
272 | | - | |
273 | | - | |
274 | | - | |
275 | | - | |
276 | | - | |
277 | | - | |
278 | | - | |
279 | | - | |
| 272 | + | |
280 | 273 | | |
281 | | - | |
| 274 | + | |
| 275 | + | |
| 276 | + | |
| 277 | + | |
| 278 | + | |
| 279 | + | |
282 | 280 | | |
283 | 281 | | |
284 | 282 | | |
| |||
0 commit comments