Message352615
Let's make test_fd_transfer_windows a bit less hangy by polling for up to 60 seconds instead of simply trying to recv() and by terminating before trying to join().
@unittest.skipUnless(HAS_REDUCTION, "test needs multiprocessing.reduction")
@unittest.skipIf(sys.platform != "win32", "Windows-only test")
def test_fd_transfer_windows(self):
if self.TYPE != 'processes':
self.skipTest("only makes sense with processes")
conn, child_conn = self.Pipe(duplex=True)
p = self.Process(target=self._check_handle_access, args=(child_conn,))
p.daemon = True
p.start()
try:
with open(test.support.TESTFN, "wb") as f:
self.addCleanup(test.support.unlink, test.support.TESTFN)
handle = msvcrt.get_osfhandle(f.fileno())
parent_access = get_handle_info(handle).GrantedAccess
reduction.send_handle(conn, handle, p.pid)
if not conn.poll(timeout=60):
raise AssertionError("could not receive from child process")
child_access = conn.recv()
self.assertEqual(parent_access, child_access)
finally:
p.terminate()
p.join() |
|
Date |
User |
Action |
Args |
2019-09-17 07:10:33 | eryksun | set | recipients:
+ eryksun, paul.moore, tim.golden, zach.ware, steve.dower, m3rc1fulcameron |
2019-09-17 07:10:33 | eryksun | set | messageid: <1568704233.09.0.97965008425.issue38188@roundup.psfhosted.org> |
2019-09-17 07:10:33 | eryksun | link | issue38188 messages |
2019-09-17 07:10:32 | eryksun | create | |
|