Skip to content

Commit 7d1abe9

Browse files
authored
gh-116682: stdout may be empty in test_cancel_futures_wait_false (#116683)
If the `shutdown()` call happens before the worker thread starts executing the task, then nothing will be printed to stdout.
1 parent 3f54d1c commit 7d1abe9

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

Lib/test/test_concurrent_futures/test_shutdown.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -247,7 +247,9 @@ def test_cancel_futures_wait_false(self):
247247
# Errors in atexit hooks don't change the process exit code, check
248248
# stderr manually.
249249
self.assertFalse(err)
250-
self.assertEqual(out.strip(), b"apple")
250+
# gh-116682: stdout may be empty if shutdown happens before task
251+
# starts executing.
252+
self.assertIn(out.strip(), [b"apple", b""])
251253

252254

253255
class ProcessPoolShutdownTest(ExecutorShutdownTest):

0 commit comments

Comments
 (0)