#3567 closed defect (fixed)

allmydata.test.test_storage_client.StoragePluginWebPresence sometimes fails with EADDRINUSE

Reported by: exarkun Owned by: GitHub <noreply@…>
Priority: normal Milestone: undecided
Component: unknown Version: n/a
Keywords: Cc:
Launchpad Bug:

Description

[ERROR]
Traceback (most recent call last):
Failure: testtools.testresult.real._StringException: logged-error: {{{
Traceback (most recent call last):
  File "/home/exarkun/VirtualEnvs/tahoe-lafs/lib/python2.7/site-packages/twisted/internet/defer.py", line 122, in execute
    result = callable(*args, **kw)
  File "/home/exarkun/VirtualEnvs/tahoe-lafs/lib/python2.7/site-packages/twisted/internet/posixbase.py", line 495, in listenTCP
    p.startListening()
  File "/home/exarkun/VirtualEnvs/tahoe-lafs/lib/python2.7/site-packages/twisted/internet/tcp.py", line 1363, in startListening
    raise CannotListenError(self.interface, self.port, le)
twisted.internet.error.CannotListenError: Couldn't listen on any:42007: [Errno 98] Address already in use.

twisted-log: 
2020-12-17 14:39:37.161Z [-] Foolscap logging initialized
2020-12-17 14:39:37.161Z [-] Note to developers: twistd.log does not receive very much.
2020-12-17 14:39:37.161Z [-] Use 'flogtool tail -c NODEDIR/private/logport.furl' instead
2020-12-17 14:39:37.161Z [-] and read docs/logging.rst
2020-12-17 14:39:37.199Z [-] My pid: 31248
2020-12-17 14:39:37.200Z [-] Listener starting on 49961
2020-12-17 14:39:37.200Z [-] Starting factory <Listener at 0x7ff5f2966510 on CleanupEndpoint(_wrapped=<twisted.internet.endpoints.AdoptedStreamServerEndpoint object at 0x7ff5f267af90>, _fd=20, _listened=True) with tub zeaca7l2pyokniku2b4uuwrvzpx4qbcd>                                                                                                                                
2020-12-17 14:39:37.201Z [-] Listener created at   File "/home/exarkun/VirtualEnvs/tahoe-lafs/lib/python2.7/site-packages/twisted/trial/_dist/workertrial.py", line 111, in <module>
            main()
          File "/home/exarkun/VirtualEnvs/tahoe-lafs/lib/python2.7/site-packages/twisted/trial/_dist/workertrial.py", line 97, in main
            workerProtocol.dataReceived(r)
          File "/home/exarkun/VirtualEnvs/tahoe-lafs/lib/python2.7/site-packages/twisted/protocols/amp.py", line 2409, in dataReceived
            return Int16StringReceiver.dataReceived(self, data)
          File "/home/exarkun/VirtualEnvs/tahoe-lafs/lib/python2.7/site-packages/twisted/protocols/basic.py", line 766, in dataReceived
            self.stringReceived(packet)
          File "/home/exarkun/VirtualEnvs/tahoe-lafs/lib/python2.7/site-packages/twisted/protocols/basic.py", line 878, in stringReceived
            self.state = statehandler(string)
          File "/home/exarkun/VirtualEnvs/tahoe-lafs/lib/python2.7/site-packages/twisted/protocols/amp.py", line 2462, in proto_key
            self.boxReceiver.ampBoxReceived(self._currentBox)
          File "/home/exarkun/VirtualEnvs/tahoe-lafs/lib/python2.7/site-packages/twisted/protocols/amp.py", line 1065, in ampBoxReceived
            self._commandReceived(box)
          File "/home/exarkun/VirtualEnvs/tahoe-lafs/lib/python2.7/site-packages/twisted/protocols/amp.py", line 1041, in _commandReceived
            deferred = self.dispatchCommand(box)
          File "/home/exarkun/VirtualEnvs/tahoe-lafs/lib/python2.7/site-packages/twisted/protocols/amp.py", line 1099, in dispatchCommand
            return maybeDeferred(responder, box)
          File "/home/exarkun/VirtualEnvs/tahoe-lafs/lib/python2.7/site-packages/twisted/internet/defer.py", line 151, in maybeDeferred
            result = f(*args, **kw)
          File "/home/exarkun/VirtualEnvs/tahoe-lafs/lib/python2.7/site-packages/twisted/protocols/amp.py", line 1186, in doit
            return maybeDeferred(aCallable, **kw).addCallback(
          File "/home/exarkun/VirtualEnvs/tahoe-lafs/lib/python2.7/site-packages/twisted/internet/defer.py", line 151, in maybeDeferred
            result = f(*args, **kw)
          File "/home/exarkun/VirtualEnvs/tahoe-lafs/lib/python2.7/site-packages/twisted/trial/_dist/worker.py", line 47, in run
            suite.run(self._result)
          File "/home/exarkun/VirtualEnvs/tahoe-lafs/lib/python2.7/site-packages/twisted/trial/runner.py", line 253, in run
            TestSuite.run(self, result)
          File "/home/exarkun/VirtualEnvs/tahoe-lafs/lib/python2.7/site-packages/twisted/trial/_asyncrunner.py", line 38, in run
            test(result)
          File "/nix/store/knrv5c2qzbxrr7f6hp5xj9zgcig36j3w-python-2.7.17/lib/python2.7/unittest/suite.py", line 70, in __call__
            return self.run(*args, **kwds)
          File "/home/exarkun/VirtualEnvs/tahoe-lafs/lib/python2.7/site-packages/twisted/trial/runner.py", line 212, in run
            super(LoggedSuite, self).run(result)
          File "/home/exarkun/VirtualEnvs/tahoe-lafs/lib/python2.7/site-packages/twisted/trial/_asyncrunner.py", line 38, in run
            test(result)
          File "/home/exarkun/VirtualEnvs/tahoe-lafs/lib/python2.7/site-packages/unittest2/case.py", line 673, in __call__
            return self.run(*args, **kwds)
          File "/home/exarkun/VirtualEnvs/tahoe-lafs/lib/python2.7/site-packages/testtools/testcase.py", line 675, in run
            return run_test.run(result)
          File "/home/exarkun/Work/python/tahoe-lafs/src/allmydata/test/eliotutil.py", line 120, in run_and_republish
            d = maybeDeferred(run, self)
          File "/home/exarkun/VirtualEnvs/tahoe-lafs/lib/python2.7/site-packages/twisted/internet/defer.py", line 151, in maybeDeferred
            result = f(*args, **kw)
          File "/home/exarkun/VirtualEnvs/tahoe-lafs/lib/python2.7/site-packages/eliot/testing.py", line 343, in wrapper
            return function(self, *args, **kwargs)
          File "/home/exarkun/VirtualEnvs/tahoe-lafs/lib/python2.7/site-packages/eliot/testing.py", line 375, in wrapper
            return function(self, logger)
          File "/home/exarkun/Work/python/tahoe-lafs/src/allmydata/test/eliotutil.py", line 96, in run
            return f(self, *a, **kw)
          File "/home/exarkun/Work/python/tahoe-lafs/src/allmydata/test/eliotutil.py", line 175, in run
            ).run(result)
          File "/home/exarkun/VirtualEnvs/tahoe-lafs/lib/python2.7/site-packages/testtools/runtest.py", line 80, in run
            return self._run_one(actual_result)
          File "/home/exarkun/VirtualEnvs/tahoe-lafs/lib/python2.7/site-packages/testtools/runtest.py", line 94, in _run_one
            return self._run_prepared_result(ExtendedToOriginalDecorator(result))
          File "/home/exarkun/VirtualEnvs/tahoe-lafs/lib/python2.7/site-packages/testtools/runtest.py", line 108, in _run_prepared_result
            self._run_core()
          File "/home/exarkun/VirtualEnvs/tahoe-lafs/lib/python2.7/site-packages/testtools/twistedsupport/_runtest.py", line 432, in _run_core
            spinner)
          File "/home/exarkun/VirtualEnvs/tahoe-lafs/lib/python2.7/site-packages/testtools/twistedsupport/_runtest.py", line 393, in _blocking_run_deferred
            spinner.run, self._timeout, self._run_deferred)
          File "/home/exarkun/VirtualEnvs/tahoe-lafs/lib/python2.7/site-packages/testtools/twistedsupport/_spinner.py", line 100, in trap_unhandled_errors
            result = function(*args, **kwargs)
          File "/home/exarkun/VirtualEnvs/tahoe-lafs/lib/python2.7/site-packages/testtools/twistedsupport/_spinner.py", line 51, in decorated
            return function(*args, **kwargs)
          File "/home/exarkun/VirtualEnvs/tahoe-lafs/lib/python2.7/site-packages/testtools/twistedsupport/_spinner.py", line 321, in run
            self._reactor.run()
          File "/home/exarkun/VirtualEnvs/tahoe-lafs/lib/python2.7/site-packages/twisted/internet/base.py", line 1282, in run
            self.startRunning(installSignalHandlers=installSignalHandlers)
          File "/home/exarkun/VirtualEnvs/tahoe-lafs/lib/python2.7/site-packages/twisted/internet/base.py", line 1262, in startRunning
            ReactorBase.startRunning(self)
          File "/home/exarkun/VirtualEnvs/tahoe-lafs/lib/python2.7/site-packages/twisted/internet/base.py", line 770, in startRunning
            self.fireSystemEvent('startup')
          File "/home/exarkun/VirtualEnvs/tahoe-lafs/lib/python2.7/site-packages/twisted/internet/base.py", line 721, in fireSystemEvent
            event.fireEvent()
          File "/home/exarkun/VirtualEnvs/tahoe-lafs/lib/python2.7/site-packages/twisted/internet/base.py", line 434, in fireEvent
            DeferredList(beforeResults).addCallback(self._continueFiring)
          File "/home/exarkun/VirtualEnvs/tahoe-lafs/lib/python2.7/site-packages/twisted/internet/defer.py", line 322, in addCallback
            callbackKeywords=kw)
          File "/home/exarkun/VirtualEnvs/tahoe-lafs/lib/python2.7/site-packages/twisted/internet/defer.py", line 311, in addCallbacks
            self._runCallbacks()
          File "/home/exarkun/VirtualEnvs/tahoe-lafs/lib/python2.7/site-packages/twisted/internet/defer.py", line 654, in _runCallbacks
            current.result = callback(current.result, *args, **kw)
          File "/home/exarkun/VirtualEnvs/tahoe-lafs/lib/python2.7/site-packages/twisted/internet/base.py", line 447, in _continueFiring
            callable(*args, **kwargs)
          File "/home/exarkun/VirtualEnvs/tahoe-lafs/lib/python2.7/site-packages/testtools/twistedsupport/_spinner.py", line 315, in run_function
            d = defer.maybeDeferred(function, *args, **kwargs)
          File "/home/exarkun/VirtualEnvs/tahoe-lafs/lib/python2.7/site-packages/twisted/internet/defer.py", line 151, in maybeDeferred
            result = f(*args, **kw)
          File "/home/exarkun/VirtualEnvs/tahoe-lafs/lib/python2.7/site-packages/testtools/twistedsupport/_runtest.py", line 377, in _run_deferred
            d = self._run_user(self.case._run_setup, self.result)
          File "/home/exarkun/VirtualEnvs/tahoe-lafs/lib/python2.7/site-packages/testtools/twistedsupport/_runtest.py", line 463, in _run_user
            d = defer.maybeDeferred(function, *args)
          File "/home/exarkun/VirtualEnvs/tahoe-lafs/lib/python2.7/site-packages/twisted/internet/defer.py", line 151, in maybeDeferred
            result = f(*args, **kw)
          File "/home/exarkun/VirtualEnvs/tahoe-lafs/lib/python2.7/site-packages/testtools/testcase.py", line 684, in _run_setup
            ret = self.setUp()
          File "/home/exarkun/VirtualEnvs/tahoe-lafs/lib/python2.7/site-packages/twisted/internet/defer.py", line 1613, in unwindGenerator
            return _cancellableInlineCallbacks(gen)
          File "/home/exarkun/VirtualEnvs/tahoe-lafs/lib/python2.7/site-packages/twisted/internet/defer.py", line 1529, in _cancellableInlineCallbacks
            _inlineCallbacks(None, g, status)
          File "/home/exarkun/VirtualEnvs/tahoe-lafs/lib/python2.7/site-packages/twisted/internet/defer.py", line 1418, in _inlineCallbacks
            result = g.send(result)
          File "/home/exarkun/Work/python/tahoe-lafs/src/allmydata/test/test_storage_client.py", line 478, in setUp
            self.node = yield self.node_fixture.create_node()
          File "/home/exarkun/Work/python/tahoe-lafs/src/allmydata/test/common.py", line 286, in create_node
            _introducer_factory=MemoryIntroducerClient,
          File "/home/exarkun/VirtualEnvs/tahoe-lafs/lib/python2.7/site-packages/twisted/internet/defer.py", line 1613, in unwindGenerator
            return _cancellableInlineCallbacks(gen)
          File "/home/exarkun/VirtualEnvs/tahoe-lafs/lib/python2.7/site-packages/twisted/internet/defer.py", line 1529, in _cancellableInlineCallbacks
            _inlineCallbacks(None, g, status)
          File "/home/exarkun/VirtualEnvs/tahoe-lafs/lib/python2.7/site-packages/twisted/internet/defer.py", line 1418, in _inlineCallbacks
            result = g.send(result)
          File "/home/exarkun/Work/python/tahoe-lafs/src/allmydata/client.py", line 279, in create_client_from_config
            foolscap_connection_handlers, i2p_provider, tor_provider,
          File "/home/exarkun/Work/python/tahoe-lafs/src/allmydata/node.py", line 906, in create_main_tub
            location,
          File "/home/exarkun/Work/python/tahoe-lafs/src/allmydata/node.py", line 852, in tub_listen_on
            tub.listenOn(port_or_endpoint)
          File "/home/exarkun/VirtualEnvs/tahoe-lafs/lib/python2.7/site-packages/foolscap/pb.py", line 517, in listenOn
            l = Listener(self, what, _test_options, self.negotiationClass)
          File "/home/exarkun/Work/python/tahoe-lafs/src/allmydata/test/__init__.py", line 87, in _listener__init__
            self._creation_stack = extract_stack()

        Traceback (most recent call last):
          File "/home/exarkun/VirtualEnvs/tahoe-lafs/lib/python2.7/site-packages/foolscap/pb.py", line 560, in startService
            service.MultiService.startService(self)
          File "/home/exarkun/VirtualEnvs/tahoe-lafs/lib/python2.7/site-packages/twisted/application/service.py", line 288, in startService
            service.startService()
          File "/home/exarkun/Work/python/tahoe-lafs/src/allmydata/test/__init__.py", line 92, in _listener_startService
            d = self._ep.listen(self)
          File "/home/exarkun/VirtualEnvs/tahoe-lafs/lib/python2.7/site-packages/twisted/internet/endpoints.py", line 495, in listen
            interface=self._interface)
        --- <exception caught here> ---
          File "/home/exarkun/VirtualEnvs/tahoe-lafs/lib/python2.7/site-packages/twisted/internet/defer.py", line 122, in execute
            result = callable(*args, **kw)
          File "/home/exarkun/VirtualEnvs/tahoe-lafs/lib/python2.7/site-packages/twisted/internet/posixbase.py", line 495, in listenTCP
            p.startListening()
          File "/home/exarkun/VirtualEnvs/tahoe-lafs/lib/python2.7/site-packages/twisted/internet/tcp.py", line 1363, in startListening
            raise CannotListenError(self.interface, self.port, le)
        twisted.internet.error.CannotListenError: Couldn't listen on any:42007: [Errno 98] Address already in use.

2020-12-17 14:39:37.203Z [-] Listener starting on 49137
2020-12-17 14:39:37.204Z [-] Starting factory <Listener at 0x7ff5f26d2710 on CleanupEndpoint(_wrapped=<twisted.internet.endpoints.AdoptedStreamServerEndpoint object at 0x7ff5f26d2290>, _fd=19, _listened=True) with tub 2fbhmzptfoi3jkgzpcuv32rpuwzy7uph>
2020-12-17 14:39:37.204Z [-] TahoeLAFSSite starting on 54271
2020-12-17 14:39:37.204Z [-] Starting factory <allmydata.webish.TahoeLAFSSite object at 0x7ff5f24d8750>
2020-12-17 14:39:37.205Z [-] client running
2020-12-17 14:39:37.209Z [-] Starting factory _HTTP11ClientFactory(<function quiescentCallback at 0x7ff5f3253ad0>, <HostnameEndpoint 127.0.0.1:54271>)
2020-12-17 14:39:37.219Z [-] web: 127.0.0.1 GET /storage-plugins/tahoe-lafs-dummy-v1/counter 200 12
2020-12-17 14:39:37.223Z [-] Starting factory _HTTP11ClientFactory(<function quiescentCallback at 0x7ff5f07b39d0>, <HostnameEndpoint 127.0.0.1:54271>)
2020-12-17 14:39:37.224Z [-] Stopping factory _HTTP11ClientFactory(<function quiescentCallback at 0x7ff5f3253ad0>, <HostnameEndpoint 127.0.0.1:54271>)
2020-12-17 14:39:37.225Z [-] web: 127.0.0.1 GET /storage-plugins/tahoe-lafs-dummy-v1/counter 200 12
2020-12-17 14:39:37.229Z [-] (TCP Port 54271 Closed)
2020-12-17 14:39:37.229Z [-] Stopping factory <allmydata.webish.TahoeLAFSSite object at 0x7ff5f24d8750>
2020-12-17 14:39:37.230Z [-] (TCP Port 49137 Closed)
2020-12-17 14:39:37.230Z [-] Stopping factory <Listener at 0x7ff5f26d2710 on CleanupEndpoint(_wrapped=<twisted.internet.endpoints.AdoptedStreamServerEndpoint object at 0x7ff5f26d2290>, _fd=19, _listened=True) with tub 2fbhmzptfoi3jkgzpcuv32rpuwzy7uph>
2020-12-17 14:39:37.230Z [-] (TCP Port 49961 Closed)
2020-12-17 14:39:37.230Z [-] Stopping factory <Listener at 0x7ff5f2966510 on CleanupEndpoint(_wrapped=<twisted.internet.endpoints.AdoptedStreamServerEndpoint object at 0x7ff5f267af90>, _fd=20, _listened=True) with tub zeaca7l2pyokniku2b4uuwrvzpx4qbcd>
2020-12-17 14:39:37.231Z [-] Stopping factory _HTTP11ClientFactory(<function quiescentCallback at 0x7ff5f07b39d0>, <HostnameEndpoint 127.0.0.1:54271>)
2020-12-17 14:39:37.233Z [-] Main loop terminated.

allmydata.test.test_storage_client.StoragePluginWebPresence.test_plugin_resource_persistent_across_requests

Change History (2)

comment:2 Changed at 2020-12-21T18:27:12Z by GitHub <noreply@…>

  • Owner set to GitHub <noreply@…>
  • Resolution set to fixed
  • Status changed from new to closed

In ab7c382/trunk:

Merge pull request #939 from LeastAuthority?/3567.test_storage_client-eaddrinuse

Use a pre-bound listening socket in the test

Fixes: ticket:3567

Note: See TracTickets for help on using tickets.