Kaydet (Commit) 6924ed55 authored tarafından grzgrzgrz3's avatar grzgrzgrz3 Kaydeden (comit) Victor Stinner

bpo-30357 each test in test_thread waits until all spawned threads finish (#1583)

* bpo-30357 each test in test_thread waits until all spawn threads finish

* bpo-30357 each test in test_thread waits until all spawn threads finish

* bpo-30357: test_thread now uses threading_cleanup() (#1592)

test_thread: setUp() now uses support.threading_setup() and
support.threading_cleanup() to wait until threads complete to avoid
random side effects on following tests.
Co-Authored-By: 's avatarVictor Stinner <victor.stinner@gmail.com>

* bpo-30357: test_thread now uses threading_cleanup() (#1592)

test_thread: setUp() now uses support.threading_setup() and
support.threading_cleanup() to wait until threads complete to avoid
random side effects on following tests.
Co-Authored-By: 's avatarVictor Stinner <victor.stinner@gmail.com>
üst 9d1983be
...@@ -22,6 +22,7 @@ def verbose_print(arg): ...@@ -22,6 +22,7 @@ def verbose_print(arg):
print arg print arg
class BasicThreadTest(unittest.TestCase): class BasicThreadTest(unittest.TestCase):
def setUp(self): def setUp(self):
...@@ -33,6 +34,9 @@ class BasicThreadTest(unittest.TestCase): ...@@ -33,6 +34,9 @@ class BasicThreadTest(unittest.TestCase):
self.running = 0 self.running = 0
self.next_ident = 0 self.next_ident = 0
key = test_support.threading_setup()
self.addCleanup(test_support.threading_cleanup, *key)
class ThreadRunningTests(BasicThreadTest): class ThreadRunningTests(BasicThreadTest):
......
...@@ -507,6 +507,7 @@ Fabian Groffen ...@@ -507,6 +507,7 @@ Fabian Groffen
Eric Groo Eric Groo
Dag Gruneau Dag Gruneau
Filip Gruszczyński Filip Gruszczyński
Grzegorz Grzywacz
Thomas Guettler Thomas Guettler
Anuj Gupta Anuj Gupta
Michael Guravage Michael Guravage
......
...@@ -12109,6 +12109,10 @@ IDLE ...@@ -12109,6 +12109,10 @@ IDLE
Tests Tests
----- -----
- bpo-30357: test_thread: setUp() now uses support.threading_setup() and
support.threading_cleanup() to wait until threads complete to avoid
random side effects on following tests. Initial patch written by Grzegorz
Grzywacz.
- Refactor test_logging to use unittest. - Refactor test_logging to use unittest.
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment