Commit d6bdbdf
committed
Fix vacuous broken-slot assertion in SenderPoolTest
testBrokenSenderIsNotReturnedToPool asserted assertNotSame(first,
second) on the two PooledSender wrappers. SenderPool.borrow() allocates
a fresh PooledSender on every call, so that comparison is unconditionally
true and proves nothing: it stays green whether or not the broken slot
was discarded. With the discard logic reverted the test failed only
incidentally, when second.close() re-threw on the recycled broken
delegate, masking the real intent.
Compare the underlying SenderSlot instead via the existing slotOf()
helper, mirroring testBorrowReturnRecyclesSameDecorator. The pool
recycles slots, not wrappers, so a broken slot leaking back to the next
borrower now surfaces as the same slot and fails the assertion directly.
The finally swallows the incidental close() exception so the assertion
result is what surfaces. Verified by injecting the bug (giveBack instead
of discardBroken on flush failure): the corrected assertion fails as a
clean Failure at the assertion line, and passes with correct code.
Also document the QueryWorker lost-dispatch coverage boundary in
QueryWorkerTest: the single-flight-reuse race fix has no deterministic
unit reproduction here because it needs the worker mid-runOn(client)
when the user thread re-dispatches, which requires a live query client.
That regression is guarded end-to-end by
QuestDBFacadeE2ETest.testSustainedMixedConcurrency in the parent repo;
testShutdownRacingDispatchMustNotStrandCaller covers only the adjacent
shutdown branch.1 parent 21becac commit d6bdbdf
2 files changed
Lines changed: 38 additions & 9 deletions
Lines changed: 16 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
39 | 39 | | |
40 | 40 | | |
41 | 41 | | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
42 | 58 | | |
43 | 59 | | |
44 | 60 | | |
| |||
Lines changed: 22 additions & 9 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
74 | 74 | | |
75 | 75 | | |
76 | 76 | | |
77 | | - | |
| 77 | + | |
78 | 78 | | |
79 | | - | |
80 | | - | |
81 | | - | |
82 | | - | |
83 | | - | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
84 | 84 | | |
85 | 85 | | |
| 86 | + | |
86 | 87 | | |
87 | 88 | | |
88 | 89 | | |
| |||
92 | 93 | | |
93 | 94 | | |
94 | 95 | | |
95 | | - | |
96 | | - | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
97 | 104 | | |
98 | | - | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
99 | 110 | | |
| 111 | + | |
| 112 | + | |
100 | 113 | | |
101 | 114 | | |
102 | 115 | | |
| |||
0 commit comments