Eryk Sun <eryk...@gmail.com> added the comment:
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() ---------- _______________________________________ Python tracker <rep...@bugs.python.org> <https://bugs.python.org/issue38188> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com