(self)
| 306 | self._test_send(lambda sock, data: sock.sendmsg([data])) |
| 307 | |
| 308 | def test_accept(self): |
| 309 | sock = socket.create_server((socket_helper.HOST, 0)) |
| 310 | self.addCleanup(sock.close) |
| 311 | port = sock.getsockname()[1] |
| 312 | |
| 313 | code = '\n'.join(( |
| 314 | 'import socket, time', |
| 315 | '', |
| 316 | f'host = {socket_helper.HOST!r}', |
| 317 | f'port = {port}', |
| 318 | f'sleep_time = {self.sleep_time!r}', |
| 319 | '', |
| 320 | '# let parent block on accept()', |
| 321 | 'time.sleep(sleep_time)', |
| 322 | 'with socket.create_connection((host, port)):', |
| 323 | ' time.sleep(sleep_time)', |
| 324 | )) |
| 325 | |
| 326 | proc = self.subprocess(code) |
| 327 | with kill_on_error(proc): |
| 328 | client_sock, _ = sock.accept() |
| 329 | client_sock.close() |
| 330 | self.assertEqual(proc.wait(), 0) |
| 331 | |
| 332 | # Issue #25122: There is a race condition in the FreeBSD kernel on |
| 333 | # handling signals in the FIFO device. Skip the test until the bug is |
nothing calls this directly
no test coverage detected