Commit dc61471
committed
Time only close() in WasUpAllAlong drain test
testAsyncCloseDrainSucceedsWhenServerWasUpAllAlong timed the whole
try (Sender = fromConfig(...)) { write; flush; } close block against a
2500ms budget, but the assertion budgets close()'s drain latency, not
sender construction. Iteration 0 is the first store-and-forward async
sender in the JVM, so fromConfig pays a one-time cold-start cost (class
loading, JIT, sf buffer mmap). On a loaded CI runner that cold start
reached ~3.26s and tripped the assertion, even though close() itself
took ~12ms.
Move t0 to wrap only sender.close(), matching the sibling test
testAsyncCloseDrainSucceedsWhenServerStartsDuringDrain. close() is
idempotent, so the try-with-resources auto-close is a no-op. Measured
close() latency stays in the single-digit milliseconds across all 20
iterations, well within the 2500ms budget.1 parent a02732c commit dc61471
1 file changed
Lines changed: 10 additions & 4 deletions
Lines changed: 10 additions & 4 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
358 | 358 | | |
359 | 359 | | |
360 | 360 | | |
361 | | - | |
362 | 361 | | |
363 | 362 | | |
364 | 363 | | |
| 364 | + | |
| 365 | + | |
| 366 | + | |
| 367 | + | |
| 368 | + | |
| 369 | + | |
| 370 | + | |
| 371 | + | |
| 372 | + | |
| 373 | + | |
365 | 374 | | |
366 | | - | |
367 | | - | |
368 | | - | |
369 | 375 | | |
370 | 376 | | |
371 | 377 | | |
| |||
0 commit comments