MCPcopy Index your code
hub / github.com/RustPython/RustPython / _testSendmsgTimeout

Method _testSendmsgTimeout

Lib/test/test_socket.py:3512–3528  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

3510 self.assertTrue(self.misc_event.wait(timeout=self.fail_timeout))
3511
3512 def _testSendmsgTimeout(self):
3513 try:
3514 self.cli_sock.settimeout(0.03)
3515 try:
3516 while True:
3517 self.sendmsgToServer([b"a"*512])
3518 except TimeoutError:
3519 pass
3520 except OSError as exc:
3521 if exc.errno != errno.ENOMEM:
3522 raise
3523 # bpo-33937 the test randomly fails on Travis CI with
3524 # "OSError: [Errno 12] Cannot allocate memory"
3525 else:
3526 self.fail("TimeoutError not raised")
3527 finally:
3528 self.misc_event.set()
3529
3530 # XXX: would be nice to have more tests for sendmsg flags argument.
3531

Callers

nothing calls this directly

Calls 4

sendmsgToServerMethod · 0.80
settimeoutMethod · 0.45
failMethod · 0.45
setMethod · 0.45

Tested by

no test coverage detected