MCPcopy Index your code
hub / github.com/python/cpython / _testSendmsgTimeout

Method _testSendmsgTimeout

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

Source from the content-addressed store, hash-verified

3613 self.assertTrue(self.misc_event.wait(timeout=self.fail_timeout))
3614
3615 def _testSendmsgTimeout(self):
3616 try:
3617 self.cli_sock.settimeout(0.03)
3618 try:
3619 while True:
3620 self.sendmsgToServer([b"a"*512])
3621 except TimeoutError:
3622 pass
3623 except OSError as exc:
3624 if exc.errno != errno.ENOMEM:
3625 raise
3626 # bpo-33937 the test randomly fails on Travis CI with
3627 # "OSError: [Errno 12] Cannot allocate memory"
3628 else:
3629 self.fail("TimeoutError not raised")
3630 finally:
3631 self.misc_event.set()
3632
3633 # XXX: would be nice to have more tests for sendmsg flags argument.
3634

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