Commit 72f1764
committed
test: Use atomic counter with random base for port allocation
Avoid intra-process port collisions between parallel tests by using an
atomic counter that increments by 2 for each allocation. The base port
is randomized once per process to reduce inter-process collisions.
This eliminates the birthday-paradox collisions that occurred when every
call independently picked a random port from the range.
AI tools were used in preparing this commit.1 parent cdc77a2 commit 72f1764
1 file changed
+15
-2
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 | | |
| |||
273 | 274 | | |
274 | 275 | | |
275 | 276 | | |
| 277 | + | |
| 278 | + | |
276 | 279 | | |
277 | | - | |
278 | | - | |
| 280 | + | |
| 281 | + | |
| 282 | + | |
| 283 | + | |
| 284 | + | |
| 285 | + | |
| 286 | + | |
| 287 | + | |
| 288 | + | |
| 289 | + | |
| 290 | + | |
| 291 | + | |
279 | 292 | | |
280 | 293 | | |
281 | 294 | | |
| |||
0 commit comments