Skip to content

Commit bb8506b

Browse files
[debugging via CI] Temporarily raise with the queue IDs.
1 parent 9a8dcdd commit bb8506b

File tree

1 file changed

+19
-6
lines changed

1 file changed

+19
-6
lines changed

Lib/test/test_concurrent_futures/test_interpreter_pool.py

Lines changed: 19 additions & 6 deletions
Original file line numberDiff line numberDiff 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

@@ -368,12 +369,24 @@ def run(ready, blocker):
368369
for i in range(numtasks):
369370
fut = executor.submit(run, ready, blocker)
370371
futures.append(fut)
371-
# Wait for them all to be ready.
372-
for i in range(numtasks):
373-
ready.get() # blocking
374-
# Unblock the workers.
375-
for i in range(numtasks):
376-
blocker.put_nowait(None)
372+
assert len(executor._threads) == numtasks, len(executor._threads)
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))
382+
# try:
383+
# # Wait for them all to be ready.
384+
# for i in range(numtasks):
385+
# ready.get() # blocking
386+
# finally:
387+
# # Unblock the workers.
388+
# for i in range(numtasks):
389+
# blocker.put_nowait(None)
377390
finally:
378391
executor.shutdown(wait=True)
379392

0 commit comments

Comments
 (0)