Skip to content

Commit eeb8e6a

Browse files
authored
Update _test_multiprocessing.py
1 parent b0676ed commit eeb8e6a

1 file changed

Lines changed: 10 additions & 0 deletions

File tree

Lib/test/_test_multiprocessing.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3889,6 +3889,16 @@ def test_context(self):
38893889
self.assertTrue(b.closed)
38903890
self.assertRaises(OSError, a.recv)
38913891
self.assertRaises(OSError, b.recv)
3892+
3893+
@warnings_helper.ignore_fork_in_thread_deprecation_warnings()
3894+
def test_wait_empty(self):
3895+
# gh-145587: wait() with empty list should respect timeout
3896+
timeout = 0.5
3897+
start = time.monotonic()
3898+
res = self.connection.wait([], timeout=timeout)
3899+
duration = time.monotonic() - start
3900+
self.assertEqual(res, [])
3901+
self.assertGreaterEqual(duration, timeout - 0.1)
38923902

38933903
class _TestListener(BaseTestCase):
38943904

0 commit comments

Comments
 (0)