Skip to content

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

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
May 15, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions Lib/test/test_thread.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ def verbose_print(arg):
print arg



class BasicThreadTest(unittest.TestCase):

def setUp(self):
Expand All @@ -33,6 +34,9 @@ def setUp(self):
self.running = 0
self.next_ident = 0

key = test_support.threading_setup()
self.addCleanup(test_support.threading_cleanup, *key)


class ThreadRunningTests(BasicThreadTest):

Expand Down
1 change: 1 addition & 0 deletions Misc/ACKS
Original file line number Diff line number Diff line change
Expand Up @@ -507,6 +507,7 @@ Fabian Groffen
Eric Groo
Dag Gruneau
Filip Gruszczyński
Grzegorz Grzywacz
Thomas Guettler
Anuj Gupta
Michael Guravage
Expand Down
4 changes: 4 additions & 0 deletions Misc/NEWS
Original file line number Diff line number Diff line change
Expand Up @@ -12106,6 +12106,10 @@ IDLE

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.

Expand Down