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

Method test_accept_econnaborted

tests/test_gthread.py:552–563  ·  view source on GitHub ↗

Test handling of ECONNABORTED during accept.

(self)

Source from the content-addressed store, hash-verified

550 assert worker.nr_conns == 0
551
552 def test_accept_econnaborted(self):
553 """Test handling of ECONNABORTED during accept."""
554 worker = self.create_worker()
555 worker.nr_conns = 0
556
557 listener = mock.Mock()
558 listener.accept.side_effect = OSError(errno.ECONNABORTED, "Connection aborted")
559
560 # Should not raise
561 worker.accept(listener)
562
563 assert worker.nr_conns == 0
564
565
566class TestGracefulShutdown:

Callers

nothing calls this directly

Calls 2

create_workerMethod · 0.95
acceptMethod · 0.45

Tested by

no test coverage detected