#2769 closed defect (fixed)

DirtyReactor failure in test_iputil.ListAddresses.test_list_async when offline

Reported by: warner Owned by: Brian Warner <warner@…>
Priority: minor Milestone: soon
Component: code Version: 1.11.0
Keywords: Cc:
Launchpad Bug:

Description

I ran the test suite from an airplane yesterday (offline), and hit a DirtyReactorError in test_iputil.ListAddresses.test_list_async. I traced it down to a failure in the call to udpprot.transport.connect(). That failure is expected (when offline), and caught, but in doing so the function fails to call port.stopListening(), and leaves the DatagramProtocol listening. That's what is dirty about the reactor at the end of the test.

I've got a simple patch that moves the stopListening() into a finally: block.

Change History (1)

comment:1 Changed at 2016-04-04T05:27:43Z by Brian Warner <warner@…>

  • Owner set to Brian Warner <warner@…>
  • Resolution set to fixed
  • Status changed from new to closed

In ce54868/trunk:

iputil.py: avoid DirtyReactorError? when running tests offline

The udpprot.transport.connect() fails if we don't have a network
connection, but the port is still listening, so trial gives us a
DirtyReactorError?. The fix is a "finally:" which does
port.stopListening() even in this case.

Closes ticket:2769

Note: See TracTickets for help on using tickets.