Commit 7ea0748
committed
test(qwp): make Invariant-B tests detect a silent retry-loop give-up
The "retries forever" tests asserted only no-terminal-in-window, but a
regressed I/O thread that gives up WITHOUT latching a terminal also
delivers nothing: flush() publishes to the cursor engine on the user
thread regardless of wire liveness, so both tests passed green with a
dead retry loop.
Back the no-terminal assertions with two discriminators:
- LIVENESS: snapshot getTotalReconnectAttempts() only after the
(ignored) reconnect budget has elapsed and require it to advance --
connectLoop bumps the counter on every attempt in both the
async-initial-connect and mid-stream reconnect phases, so a frozen
counter means the loop exited silently. A plain attempts >= 1 check
would not discriminate: pre-budget attempts would satisfy it.
Applied to testAsyncNoServerRetriesForeverNoTerminal,
testConnectionLostRetriesForeverNoTerminal, and
testReconnectNeverGivesUpInvariantB.
- RECOVERY: in testReconnectNeverGivesUpInvariantB, revive a server on
the SAME port (the requestedPort constructor exists for down-then-up
outage realism) and require a replayed frame to arrive -- end-to-end
proof that "retry forever" converts into delivery once the server
returns. The revival handler is receipt-only: faking ACKs would
couple the test to the exact replay FSN sequence and a wrong-seq ACK
risks the invalid-ACK terminal.
Also fix the test comment claiming flush publishes to on-disk SF: no
sf_dir is configured there, so rows buffer in the in-RAM cursor ring.1 parent 53bab20 commit 7ea0748
2 files changed
Lines changed: 100 additions & 4 deletions
File tree
- core/src/test/java/io/questdb/client/test/cutlass/qwp/client
Lines changed: 38 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
139 | 139 | | |
140 | 140 | | |
141 | 141 | | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
142 | 150 | | |
143 | 151 | | |
144 | 152 | | |
| |||
269 | 277 | | |
270 | 278 | | |
271 | 279 | | |
| 280 | + | |
| 281 | + | |
| 282 | + | |
| 283 | + | |
| 284 | + | |
272 | 285 | | |
273 | 286 | | |
274 | 287 | | |
| |||
321 | 334 | | |
322 | 335 | | |
323 | 336 | | |
| 337 | + | |
| 338 | + | |
| 339 | + | |
| 340 | + | |
| 341 | + | |
| 342 | + | |
| 343 | + | |
| 344 | + | |
| 345 | + | |
| 346 | + | |
| 347 | + | |
| 348 | + | |
| 349 | + | |
| 350 | + | |
| 351 | + | |
| 352 | + | |
| 353 | + | |
| 354 | + | |
| 355 | + | |
| 356 | + | |
| 357 | + | |
| 358 | + | |
| 359 | + | |
| 360 | + | |
| 361 | + | |
324 | 362 | | |
325 | 363 | | |
326 | 364 | | |
| |||
Lines changed: 62 additions & 4 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
104 | 104 | | |
105 | 105 | | |
106 | 106 | | |
107 | | - | |
108 | | - | |
109 | | - | |
110 | | - | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
111 | 117 | | |
112 | 118 | | |
113 | 119 | | |
| |||
144 | 150 | | |
145 | 151 | | |
146 | 152 | | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
| 174 | + | |
| 175 | + | |
| 176 | + | |
| 177 | + | |
| 178 | + | |
| 179 | + | |
| 180 | + | |
| 181 | + | |
| 182 | + | |
| 183 | + | |
| 184 | + | |
| 185 | + | |
| 186 | + | |
| 187 | + | |
| 188 | + | |
147 | 189 | | |
148 | 190 | | |
149 | 191 | | |
| |||
529 | 571 | | |
530 | 572 | | |
531 | 573 | | |
| 574 | + | |
| 575 | + | |
| 576 | + | |
| 577 | + | |
| 578 | + | |
| 579 | + | |
| 580 | + | |
| 581 | + | |
| 582 | + | |
| 583 | + | |
| 584 | + | |
| 585 | + | |
| 586 | + | |
| 587 | + | |
| 588 | + | |
| 589 | + | |
532 | 590 | | |
533 | 591 | | |
534 | 592 | | |
| |||
0 commit comments