https://github.com/python/cpython/commit/a01621aeb4a9b4e9307aba1ff7a772af1de931f8
commit: a01621aeb4a9b4e9307aba1ff7a772af1de931f8
branch: 3.11
author: Miss Islington (bot) <[email protected]>
committer: colesbury <[email protected]>
date: 2024-03-13T00:29:03Z
summary:

[3.11] gh-116682: stdout may be empty in test_cancel_futures_wait_false 
(GH-116683) (#116693)

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

Co-authored-by: Sam Gross <[email protected]>

files:
M Lib/test/test_concurrent_futures/test_shutdown.py

diff --git a/Lib/test/test_concurrent_futures/test_shutdown.py 
b/Lib/test/test_concurrent_futures/test_shutdown.py
index 45dab7a75fdd50..7a4065afd46fc8 100644
--- a/Lib/test/test_concurrent_futures/test_shutdown.py
+++ b/Lib/test/test_concurrent_futures/test_shutdown.py
@@ -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):

_______________________________________________
Python-checkins mailing list -- [email protected]
To unsubscribe send an email to [email protected]
https://mail.python.org/mailman3/lists/python-checkins.python.org/
Member address: [email protected]

Reply via email to