Skip to content
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

bpo-43952: Fix multiprocessing Listener authkey bug #25845

Merged
merged 3 commits into from
Feb 27, 2024
Merged
Changes from 1 commit
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
Prev Previous commit
Next Next commit
Remove signal
miguendes committed May 3, 2021
commit 39d84034e405e9f358857dd2fafbfbf52cff23ba
15 changes: 4 additions & 11 deletions Lib/test/_test_multiprocessing.py
Original file line number Diff line number Diff line change
@@ -3309,19 +3309,12 @@ def run(addr, authkey):
client = self.connection.Client(addr, authkey=authkey)
client.send(1729)

timeout_in_s = 2
key = b""

try:
# wait 2s so the test won't hang forever in case of regression
signal.signal(signal.SIGALRM, handler)
signal.alarm(timeout_in_s)
with self.connection.Listener(authkey=key) as listener:
threading.Thread(target=run, args=(listener.address, key)).start()
with listener.accept() as d:
self.assertEqual(d.recv(), 1729)
finally:
signal.alarm(0)
with self.connection.Listener(authkey=key) as listener:
threading.Thread(target=run, args=(listener.address, key)).start()
with listener.accept() as d:
self.assertEqual(d.recv(), 1729)

if self.TYPE == 'processes':
self.assertRaises(OSError, listener.accept)