| 5958 | @warnings_helper.ignore_fork_in_thread_deprecation_warnings() |
| 5959 | @unittest.skipUnless(hasattr(signal, 'SIGUSR1'), 'requires SIGUSR1') |
| 5960 | def test_ignore(self): |
| 5961 | conn, child_conn = multiprocessing.Pipe() |
| 5962 | try: |
| 5963 | p = multiprocessing.Process(target=self._test_ignore, |
| 5964 | args=(child_conn,)) |
| 5965 | p.daemon = True |
| 5966 | p.start() |
| 5967 | child_conn.close() |
| 5968 | self.assertEqual(conn.recv(), 'ready') |
| 5969 | time.sleep(0.1) |
| 5970 | os.kill(p.pid, signal.SIGUSR1) |
| 5971 | time.sleep(0.1) |
| 5972 | conn.send(1234) |
| 5973 | self.assertEqual(conn.recv(), 1234) |
| 5974 | time.sleep(0.1) |
| 5975 | os.kill(p.pid, signal.SIGUSR1) |
| 5976 | self.assertEqual(conn.recv_bytes(), b'x' * self.CONN_MAX_SIZE) |
| 5977 | time.sleep(0.1) |
| 5978 | p.join() |
| 5979 | finally: |
| 5980 | conn.close() |
| 5981 | |
| 5982 | @classmethod |
| 5983 | def _test_ignore_listener(cls, conn): |