MCPcopy
hub / github.com/benoitc/gunicorn / test_accept_eagain

Method test_accept_eagain

tests/test_gthread.py:539–550  ·  view source on GitHub ↗

Test handling of EAGAIN during accept.

(self)

Source from the content-addressed store, hash-verified

537 worker.tpool.submit.assert_called_once()
538
539 def test_accept_eagain(self):
540 """Test handling of EAGAIN during accept."""
541 worker = self.create_worker()
542 worker.nr_conns = 0
543
544 listener = mock.Mock()
545 listener.accept.side_effect = OSError(errno.EAGAIN, "Try again")
546
547 # Should not raise
548 worker.accept(listener)
549
550 assert worker.nr_conns == 0
551
552 def test_accept_econnaborted(self):
553 """Test handling of ECONNABORTED during accept."""

Callers

nothing calls this directly

Calls 2

create_workerMethod · 0.95
acceptMethod · 0.45

Tested by

no test coverage detected