mirror of
https://github.com/tahoe-lafs/tahoe-lafs.git
synced 2025-02-21 02:01:31 +00:00
test_rref passes now.
This commit is contained in:
parent
0d23237b11
commit
b80a215ae1
@ -1052,10 +1052,9 @@ class HTTPNativeStorageServer(service.MultiService):
|
||||
"""
|
||||
See ``IServer.get_storage_server``.
|
||||
"""
|
||||
if self.is_connected():
|
||||
return self._istorage_server
|
||||
else:
|
||||
if self._connection_status.summary == "unstarted":
|
||||
return None
|
||||
return self._istorage_server
|
||||
|
||||
def stop_connecting(self):
|
||||
self._lc.stop()
|
||||
@ -1070,10 +1069,11 @@ class HTTPNativeStorageServer(service.MultiService):
|
||||
)
|
||||
|
||||
def stopService(self):
|
||||
service.MultiService.stopService(self)
|
||||
result = service.MultiService.stopService(self)
|
||||
if self._lc.running:
|
||||
self._lc.stop()
|
||||
self._failed_to_connect("shut down")
|
||||
return result
|
||||
|
||||
|
||||
class UnknownServerTypeError(Exception):
|
||||
|
@ -21,6 +21,7 @@ from functools import partial
|
||||
from twisted.internet import reactor
|
||||
from twisted.internet import defer
|
||||
from twisted.internet.defer import inlineCallbacks
|
||||
from twisted.internet.task import deferLater
|
||||
from twisted.application import service
|
||||
|
||||
from foolscap.api import flushEventualQueue
|
||||
@ -658,6 +659,7 @@ class SystemTestMixin(pollmixin.PollMixin, testutil.StallMixin):
|
||||
log.msg("shutting down SystemTest services")
|
||||
d = self.sparent.stopService()
|
||||
d.addBoth(flush_but_dont_ignore)
|
||||
d.addBoth(lambda x: deferLater(reactor, 0.01, lambda: x))
|
||||
return d
|
||||
|
||||
def getdir(self, subdir):
|
||||
|
@ -1821,9 +1821,10 @@ class Connections(SystemTestMixin, unittest.TestCase):
|
||||
|
||||
# now shut down the server
|
||||
d.addCallback(lambda ign: self.clients[1].disownServiceParent())
|
||||
|
||||
# and wait for the client to notice
|
||||
def _poll():
|
||||
return len(self.c0.storage_broker.get_connected_servers()) < 2
|
||||
return len(self.c0.storage_broker.get_connected_servers()) == 1
|
||||
d.addCallback(lambda ign: self.poll(_poll))
|
||||
|
||||
def _down(ign):
|
||||
|
Loading…
x
Reference in New Issue
Block a user