Ticket #5899 defect closed fixed

Opened 20 months ago

Last modified 20 months ago

twisted.internet.test.test_tcp.TCPTransportServerAddressTestMixin._testServerAddress hangs for the test method timeout when it fails

Reported by: exarkun Owned by: exarkun
Priority: high Milestone:
Component: core Keywords: tests
Cc: Branch: branches/faster-serveraddresstcp4-failure-5899
(diff, github, buildbot, log)
Author: exarkun Launchpad Bug:

Description

This test method helper relies on getConnectedClientAndServer to stop the reactor after the client/server connection is lost.

The connection is closed at the end of the nested connected callback inside _testServerAddress. However, if any of the assertions in connected fail, the connection won't be closed and the test will hang until the timeout triggers.

Change History

1

Changed 20 months ago by exarkun

  • status changed from new to assigned
  • owner set to exarkun

2

Changed 20 months ago by exarkun

  • branch set to branches/faster-serveraddresstcp4-failure-5899
  • branch_author set to exarkun

(In [35494]) Branching to 'faster-serveraddresstcp4-failure-5899'

3

Changed 20 months ago by exarkun

(In [35495]) Close the connection with a try/finally

refs #5899

4

Changed 20 months ago by exarkun

  • keywords review added
  • status changed from assigned to new
  • owner exarkun deleted

When this test fails like this:

2012-09-03 09:06:45-0400 [Uninitialized] Unhandled Error
        Traceback (most recent call last):
          File "/home/exarkun/Projects/Twisted/trunk/twisted/internet/defer.py", line 551, in _runCallbacks
            current.result = callback(current.result, *args, **kw)
          File "/home/exarkun/Projects/Twisted/trunk/twisted/internet/test/test_tcp.py", line 1414, in start
            deferred.callback((client, server, port))
          File "/home/exarkun/Projects/Twisted/trunk/twisted/internet/defer.py", line 368, in callback
            self._startRunCallbacks(result)
          File "/home/exarkun/Projects/Twisted/trunk/twisted/internet/defer.py", line 464, in _startRunCallbacks
            self._runCallbacks()
        --- <exception caught here> ---
          File "/home/exarkun/Projects/Twisted/trunk/twisted/internet/defer.py", line 551, in _runCallbacks
            current.result = callback(current.result, *args, **kw)
          File "/home/exarkun/Projects/Twisted/trunk/twisted/internet/test/test_tcp.py", line 1335, in connected
            server.transport.logstr)
          File "/home/exarkun/Projects/Twisted/trunk/twisted/trial/unittest.py", line 271, in assertEqual
            % (msg, pformat(first), pformat(second)))
        twisted.trial.unittest.FailTest: not equal:
        a = 'AccumulatingProtocol,0,127.0.0.1'
        b = 'AccumulatingProtocol,0,10.0.0.1'

it now does so immediately rather than only after two minutes.  Build results

5

Changed 20 months ago by therve

  • owner set to exarkun
  • keywords review removed

Looks goods, sorry for writing the bad test in the first place... Please merge.

6

Changed 20 months ago by exarkun

  • status changed from new to closed
  • resolution set to fixed

(In [35704]) Merge faster-serveraddresstcp4-failure-5899

Author: exarkun Reviewer: therve Fixes: #5899

Speed up the failure of some twisted.internet.test.test_tcp tests, should they fail at all.

Note: See TracTickets for help on using tickets.