Skip to content
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
3 changes: 3 additions & 0 deletions Lib/test/test_concurrent_futures.py
Original file line number Diff line number Diff line change
Expand Up @@ -772,6 +772,7 @@ def notification():
t.start()

self.assertEqual(f1.result(timeout=5), 42)
t.join()

def test_result_with_cancel(self):
# TODO([email protected]): This test is timing dependent.
Expand All @@ -785,6 +786,7 @@ def notification():
t.start()

self.assertRaises(futures.CancelledError, f1.result, timeout=5)
t.join()

def test_exception_with_timeout(self):
self.assertRaises(futures.TimeoutError,
Expand Down Expand Up @@ -813,6 +815,7 @@ def notification():
t.start()

self.assertTrue(isinstance(f1.exception(timeout=5), OSError))
t.join()

@test.support.reap_threads
def test_main():
Expand Down
3 changes: 3 additions & 0 deletions Lib/test/test_decimal.py
Original file line number Diff line number Diff line change
Expand Up @@ -1618,6 +1618,9 @@ def test_threading(self):
for sig in Signals[self.decimal]:
self.assertFalse(DefaultContext.flags[sig])

th1.join()
th2.join()

DefaultContext.prec = save_prec
DefaultContext.Emax = save_emax
DefaultContext.Emin = save_emin
Expand Down
4 changes: 3 additions & 1 deletion Lib/test/test_smtplib.py
Original file line number Diff line number Diff line change
Expand Up @@ -611,7 +611,9 @@ def setUp(self):
self.sock.settimeout(15)
self.port = support.bind_port(self.sock)
servargs = (self.evt, self.respdata, self.sock)
threading.Thread(target=server, args=servargs).start()
thread = threading.Thread(target=server, args=servargs)
thread.start()
self.addCleanup(thread.join)
self.evt.wait()
self.evt.clear()

Expand Down
8 changes: 6 additions & 2 deletions Lib/test/test_xmlrpc.py
Original file line number Diff line number Diff line change
Expand Up @@ -755,7 +755,9 @@ def setUp(self):
self.evt = threading.Event()
# start server thread to handle requests
serv_args = (self.evt, self.request_count, self.requestHandler)
threading.Thread(target=self.threadFunc, args=serv_args).start()
thread = threading.Thread(target=self.threadFunc, args=serv_args)
thread.start()
self.addCleanup(thread.join)

# wait for the server to be ready
self.evt.wait()
Expand Down Expand Up @@ -1206,7 +1208,9 @@ def setUp(self):
self.evt = threading.Event()
# start server thread to handle requests
serv_args = (self.evt, 1)
threading.Thread(target=http_server, args=serv_args).start()
thread = threading.Thread(target=http_server, args=serv_args)
thread.start()
self.addCleanup(thread.join)

# wait for the server to be ready
self.evt.wait()
Expand Down