Commit cce3001
committed
test(qwp): assert slot distinctness, not wrapper identity, in pool borrow tests
SenderPool.borrow() allocates a fresh PooledSender wrapper on every call,
so assertNotSame on the wrappers is unconditionally true and proves
nothing -- it stays green even if the pool double-lends a single slot to
concurrent borrowers. Commits d6bdbdf and e77b4fc fixed this exact
pattern in testBrokenSenderIsNotReturnedToPool and
SenderPoolErrorSafetyTest via slotOf(); two more instances remained.
SenderPoolTest.testPoolBuildsRequestedNumberOfSenders: compare the
underlying slots pairwise via slotOf() and assert totalSize() == 3, so
the test actually verifies what its name claims -- three concurrent
borrowers each hold their own sender.
SenderPoolSfTest.testTwoConcurrentSfSendersGetDistinctSlots: the slot-dir
assertions prove the pool created two slots on disk, but not that the two
borrowed handles wrap different ones; replace the vacuous wrapper
comparison with slotOf() distinctness (helper added, mirroring
SenderPoolTest and SenderPoolErrorSafetyTest).
QueryImplResetTest's assertNotSame on leases is left as-is: it is an
intentional contract pin (fresh lease wrapper per borrow) paired with the
load-bearing assertSame on the shared QueryImpl.1 parent 8393065 commit cce3001
2 files changed
Lines changed: 31 additions & 5 deletions
Lines changed: 16 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
108 | 108 | | |
109 | 109 | | |
110 | 110 | | |
111 | | - | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
112 | 117 | | |
113 | 118 | | |
114 | 119 | | |
| |||
1947 | 1952 | | |
1948 | 1953 | | |
1949 | 1954 | | |
| 1955 | + | |
| 1956 | + | |
| 1957 | + | |
| 1958 | + | |
| 1959 | + | |
| 1960 | + | |
| 1961 | + | |
| 1962 | + | |
| 1963 | + | |
| 1964 | + | |
1950 | 1965 | | |
1951 | 1966 | | |
1952 | 1967 | | |
| |||
Lines changed: 15 additions & 4 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
196 | 196 | | |
197 | 197 | | |
198 | 198 | | |
199 | | - | |
| 199 | + | |
200 | 200 | | |
201 | 201 | | |
202 | 202 | | |
203 | 203 | | |
204 | | - | |
205 | | - | |
206 | | - | |
| 204 | + | |
| 205 | + | |
| 206 | + | |
| 207 | + | |
| 208 | + | |
| 209 | + | |
| 210 | + | |
| 211 | + | |
| 212 | + | |
| 213 | + | |
| 214 | + | |
| 215 | + | |
| 216 | + | |
| 217 | + | |
207 | 218 | | |
208 | 219 | | |
209 | 220 | | |
| |||
0 commit comments