Skip to content

Commit

Permalink
pythongh-116682: stdout may be empty in test_cancel_futures_wait_false (
Browse files Browse the repository at this point in the history
pythonGH-116683)

If the `shutdown()` call happens before the worker thread starts executing
the task, then nothing will be printed to stdout.
(cherry picked from commit 7d1abe9)

Co-authored-by: Sam Gross <colesbury@gmail.com>
  • Loading branch information
colesbury authored and miss-islington committed Mar 13, 2024
1 parent 0917338 commit 38399bd
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion Lib/test/test_concurrent_futures/test_shutdown.py
Expand Up @@ -247,7 +247,9 @@ def test_cancel_futures_wait_false(self):
# Errors in atexit hooks don't change the process exit code, check
# stderr manually.
self.assertFalse(err)
self.assertEqual(out.strip(), b"apple")
# gh-116682: stdout may be empty if shutdown happens before task
# starts executing.
self.assertIn(out.strip(), [b"apple", b""])


class ProcessPoolShutdownTest(ExecutorShutdownTest):
Expand Down

0 comments on commit 38399bd

Please sign in to comment.