self.introducer_reconnector = self.tub.connectTo(self.introducer_furl,
self._got_introducer)
def connect_failed(failure):
- self.log("\n\nInitial Introducer connection failed: perhaps it's down\n")
- log.err(failure)
+ self.log("\n\nInitial Introducer connection failed: "
+ "perhaps it's down\n")
+ self.log(str(failure))
d = self.tub.getReference(self.introducer_furl)
d.addErrback(connect_failed)
import os
from twisted.trial import unittest
from twisted.application import service
+from twisted.internet import reactor, defer
import allmydata
from allmydata import client, introducer
open(os.path.join(basedir, "suicide_prevention_hotline"), "w")
c = client.Client(basedir)
+ def stall(self, res=None, delay=1):
+ d = defer.Deferred()
+ reactor.callLater(delay, d.callback, res)
+ return d
+
def test_reloadable(self):
basedir = "test_client.Run.test_reloadable"
os.mkdir(basedir)
c1 = client.Client(basedir)
c1.setServiceParent(self.sparent)
- d = c1.disownServiceParent()
+ d = self.stall(delay=0.1)
+ d.addCallback(lambda res: c1.disownServiceParent())
def _restart(res):
c2 = client.Client(basedir)
c2.setServiceParent(self.sparent)