Skip to content

gh-87135: test_threading: Wait on thread, not an Event it sets #133198

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
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
8 changes: 4 additions & 4 deletions Lib/test/test_threading.py
Original file line number Diff line number Diff line change
Expand Up @@ -1219,18 +1219,18 @@ def test_join_finished_daemon_thread_in_finalization(self):
import threading
done = threading.Event()

def loop():
def set_event():
done.set()


class Cycle:
def __init__(self):
self.self_ref = self
self.thr = threading.Thread(target=loop, daemon=True)
self.thr = threading.Thread(target=set_event, daemon=True)
self.thr.start()
done.wait()
self.thr.join()

def __del__(self):
assert done.is_set()
assert not self.thr.is_alive()
self.thr.join()
assert not self.thr.is_alive()
Expand Down
Loading