[Python-checkins] gh-89898: Fix test_threading.test_args_argument() (GH-92885)

miss-islington webhook-mailer at python.org
Tue May 17 18:46:06 EDT 2022


https://github.com/python/cpython/commit/58088a544c825ecc14733699c4cf32377049434e
commit: 58088a544c825ecc14733699c4cf32377049434e
branch: 3.11
author: Miss Islington (bot) <31488909+miss-islington at users.noreply.github.com>
committer: miss-islington <31488909+miss-islington at users.noreply.github.com>
date: 2022-05-17T15:45:56-07:00
summary:

gh-89898: Fix test_threading.test_args_argument() (GH-92885)


Join the thread to not leak threads running in the background to the
next test.

Fix the following warning on the "AMD64 FreeBSD Shared 3.11"
buildbot:

test_args_argument (test.test_threading.ThreadTests.test_args_argument) ...
Warning -- threading_cleanup() failed to cleanup 1 threads (count: 1, dangling: 2)
Warning -- Dangling thread: <_MainThread(MainThread, started 35026161664)>
Warning -- Dangling thread: <Thread(Thread-134 (<lambda>), started 35314998016)>
ok
(cherry picked from commit 970efae274538f9910e8f9b31bc890f1b7666b0f)

Co-authored-by: Victor Stinner <vstinner at python.org>

files:
M Lib/test/test_threading.py

diff --git a/Lib/test/test_threading.py b/Lib/test/test_threading.py
index f7dea136a87c0..9c6561c099f57 100644
--- a/Lib/test/test_threading.py
+++ b/Lib/test/test_threading.py
@@ -149,6 +149,7 @@ def test_args_argument(self):
             with self.subTest(target=target, args=args):
                 t = threading.Thread(target=target, args=args)
                 t.start()
+                t.join()
 
     @cpython_only
     def test_disallow_instantiation(self):



More information about the Python-checkins mailing list