Commit b40e782
committed
test(qwp): allocate distinct ports atomically in the all-unreachable walk test
CI (linux-x64, build 247632) failed QwpQueryClientWalkTrackerTest.
testWalk_AllUnreachableThrowsHttpClientException with
IllegalArgumentException: "duplicate addr entry: localhost:39695".
Root cause: the test picked its two unreachable ports with two
back-to-back TestPorts.findUnusedPort() calls. That helper is
bind-close-return -- once its probe ServerSocket closes, the port goes
back to the kernel's ephemeral pool, and Linux readily hands the
just-released port to the next bind(0). Both calls returned the same
port, the config became addr=localhost:P,localhost:P, and ConfigView's
duplicate-addr validation (84da57d, pre-existing on main) rejected it
before the endpoint walk under test ever ran. Latent flake since the
test was written; unrelated to this PR's changes.
Fix: TestPorts.findUnusedPorts(n) holds all n probe sockets open
simultaneously, forcing the kernel to issue n distinct ports, and
closes them together. The walk test uses findUnusedPorts(2). This is
the only call site combining independently-picked ports into one
config (verified: other multi-call tests use one port per config).1 parent 766832d commit b40e782
2 files changed
Lines changed: 47 additions & 3 deletions
File tree
- core/src/test/java/io/questdb/client/test/cutlass/qwp/client
Lines changed: 7 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
170 | 170 | | |
171 | 171 | | |
172 | 172 | | |
173 | | - | |
174 | | - | |
| 173 | + | |
| 174 | + | |
| 175 | + | |
| 176 | + | |
| 177 | + | |
| 178 | + | |
175 | 179 | | |
176 | | - | |
| 180 | + | |
177 | 181 | | |
178 | 182 | | |
179 | 183 | | |
| |||
Lines changed: 40 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
40 | 40 | | |
41 | 41 | | |
42 | 42 | | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
43 | 83 | | |
0 commit comments