diff options
author | Miss Islington (bot) <31488909+miss-islington@users.noreply.github.com> | 2024-03-13 00:28:21 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-03-13 00:28:21 (GMT) |
commit | 84c8925e136d22daab4c9172e272137f5b76d9cf (patch) | |
tree | 5de33652da2f873ee681814b12fc14afd011283b | |
parent | acd7dc7ab06c5ee89155f10bf184af4839884fb6 (diff) | |
download | cpython-84c8925e136d22daab4c9172e272137f5b76d9cf.zip cpython-84c8925e136d22daab4c9172e272137f5b76d9cf.tar.gz cpython-84c8925e136d22daab4c9172e272137f5b76d9cf.tar.bz2 |
[3.12] gh-116682: stdout may be empty in test_cancel_futures_wait_false (GH-116683) (#116692)
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 <colesbury@gmail.com>
-rw-r--r-- | Lib/test/test_concurrent_futures/test_shutdown.py | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/Lib/test/test_concurrent_futures/test_shutdown.py b/Lib/test/test_concurrent_futures/test_shutdown.py index 45dab7a..7a4065a 100644 --- a/Lib/test/test_concurrent_futures/test_shutdown.py +++ b/Lib/test/test_concurrent_futures/test_shutdown.py @@ -247,7 +247,9 @@ class ThreadPoolShutdownTest(ThreadPoolMixin, ExecutorShutdownTest, BaseTestCase # 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): |