Commit e77b4fc
committed
Fix vacuous flush-Error assertion in SenderPoolErrorSafetyTest
flushErrorDiscardsBrokenSenderInsteadOfRecycling 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 the broken slot was discarded (discardBroken) or recycled
(giveBack). Reverting PooledSender.close()'s discard fix left the test
green, so the only coverage of the flush-Error discard path was dead.
Capture the underlying SenderSlot before close() and compare slots via a
new slotOf() reflective helper, mirroring the sibling fix in d6bdbdf
(SenderPoolTest.testBrokenSenderIsNotReturnedToPool). 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
existing "close() must propagate the Error" assertion is unchanged.
Verified: with the bug injected (giveBack instead of discardBroken) the
assertion now fails as expected; green against the real discardBroken.1 parent df6f7ca commit e77b4fc
1 file changed
Lines changed: 16 additions & 1 deletion
Lines changed: 16 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
25 | 25 | | |
26 | 26 | | |
27 | 27 | | |
| 28 | + | |
28 | 29 | | |
29 | 30 | | |
30 | 31 | | |
31 | 32 | | |
| 33 | + | |
32 | 34 | | |
33 | 35 | | |
34 | 36 | | |
| |||
95 | 97 | | |
96 | 98 | | |
97 | 99 | | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
98 | 107 | | |
99 | 108 | | |
100 | 109 | | |
| |||
106 | 115 | | |
107 | 116 | | |
108 | 117 | | |
109 | | - | |
| 118 | + | |
110 | 119 | | |
111 | 120 | | |
112 | 121 | | |
| |||
118 | 127 | | |
119 | 128 | | |
120 | 129 | | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
121 | 136 | | |
122 | 137 | | |
123 | 138 | | |
| |||
0 commit comments