Commit fee9903
committed
test(client): fix closeStarted race in closed-mid-creation lock-probe test
closedMidCreationTeardownRunsOutsideThePoolLock started the pool-closer
thread and the idempotent-re-close lock probe with nothing ordering their
entry into close(). On a slow scheduler (Windows CI, build 251972) the
probe won the closeStarted race, became the primary closer and
legitimately parked in the new bounded 5s in-flight-creation wait -- the
parked teardown deliberately holds inFlightCreations at 1 -- so
probe.join(5s) expired and the lock-free assertion failed even though
the pool lock was free the whole time.
Wait on the hasCreationWaiterForTesting() seam until the pool-closer has
claimed closeStarted and parked in the creation wait (releasing the
lock) before starting the probe, making the probe a true re-close. Also
swap the reflective markClosing() invoke for the markClosingForTesting()
seam. Reproduced by delaying the closer thread 400ms: the old test fails
with the exact CI assertion in 5.1s; the fixed test passes in 0.5s under
the same delay.1 parent a167e65 commit fee9903
1 file changed
Lines changed: 16 additions & 3 deletions
Lines changed: 16 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
288 | 288 | | |
289 | 289 | | |
290 | 290 | | |
291 | | - | |
292 | | - | |
293 | | - | |
| 291 | + | |
294 | 292 | | |
295 | 293 | | |
296 | 294 | | |
297 | 295 | | |
298 | 296 | | |
299 | 297 | | |
300 | 298 | | |
| 299 | + | |
| 300 | + | |
| 301 | + | |
| 302 | + | |
| 303 | + | |
| 304 | + | |
| 305 | + | |
| 306 | + | |
| 307 | + | |
| 308 | + | |
| 309 | + | |
| 310 | + | |
| 311 | + | |
| 312 | + | |
| 313 | + | |
301 | 314 | | |
302 | 315 | | |
303 | 316 | | |
| |||
0 commit comments