test_rref passes now.

This commit is contained in:
Itamar Turner-Trauring 2022-10-13 13:56:28 -04:00
parent 0d23237b11
commit b80a215ae1
3 changed files with 8 additions and 5 deletions

View File

@ -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):

View File

@ -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):

View File

@ -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):