File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -260,7 +260,7 @@ def wait_closed() -> None:
260260 self .assertEqual (pool .live_spare_dirs (), set ())
261261 self .assertGreaterEqual (pool .close_count , pool .build_count )
262262
263- def test_concurrent_take_and_refill_uses_barrier (self ) -> None :
263+ def test_concurrent_take_and_notify_does_not_deadlock (self ) -> None :
264264 pool = self ._pool ()
265265 fp = _fp ()
266266 barrier = threading .Barrier (2 )
@@ -292,7 +292,15 @@ def notifier() -> None:
292292 t2 .join (timeout = 5 )
293293 self .assertEqual (len (results ), 1 )
294294 self .assertIsNotNone (results [0 ])
295+ # notify may run before take empties the slot; nudge refill deterministically.
296+ pool .notify_scrape_finished (fp )
295297 self ._wait_spare (pool )
298+ hit = results [0 ]
299+ assert hit is not None
300+ driver , spare_dir = hit
301+ driver .close ()
302+ shutil .rmtree (spare_dir , ignore_errors = True )
303+ pool .release_adopted (spare_dir )
296304 pool .shutdown ()
297305
298306 def test_min_refill_backoff (self ) -> None :
You can’t perform that action at this time.
0 commit comments