File tree Expand file tree Collapse file tree 1 file changed +10
-3
lines changed
Lib/test/test_concurrent_futures Expand file tree Collapse file tree 1 file changed +10
-3
lines changed Original file line number Diff line number Diff line change @@ -358,6 +358,7 @@ def test_blocking(self):
358358 blocker = queues .create ()
359359
360360 def run (ready , blocker ):
361+ raise Exception ((ready .id , blocker .id ))
361362 ready .put (None )
362363 blocker .get () # blocking
363364
@@ -369,9 +370,15 @@ def run(ready, blocker):
369370 fut = executor .submit (run , ready , blocker )
370371 futures .append (fut )
371372 assert len (executor ._threads ) == numtasks , len (executor ._threads )
372- # Unblock the workers.
373- for i in range (numtasks ):
374- blocker .put_nowait (None )
373+ ctx = None
374+ for i , fut in enumerate (futures , 1 ):
375+ try :
376+ fut .result (timeout = 10 )
377+ except Exception as exc :
378+ exc .__cause__ = ctx
379+ ctx = exc
380+ if i == numtasks :
381+ raise Exception ((ready .id , blocker .id ))
375382# try:
376383# # Wait for them all to be ready.
377384# for i in range(numtasks):
You can’t perform that action at this time.
0 commit comments