mirror of
https://github.com/tahoe-lafs/tahoe-lafs.git
synced 2025-05-02 00:53:01 +00:00
fuse: runtests.py: Fix bug in polling_operation error that always referred to introducer.furl.
This commit is contained in:
parent
4f94d00abe
commit
4d8aac35f4
@ -183,7 +183,8 @@ class SystemTest (object):
|
|||||||
|
|
||||||
introfurl = os.path.join(introbase, 'introducer.furl')
|
introfurl = os.path.join(introbase, 'introducer.furl')
|
||||||
|
|
||||||
self.polling_operation(lambda : os.path.isfile(introfurl))
|
self.polling_operation(lambda : os.path.isfile(introfurl),
|
||||||
|
'introducer.furl creation')
|
||||||
shutil.copy(introfurl, base)
|
shutil.copy(introfurl, base)
|
||||||
|
|
||||||
# NOTE: We assume if tahoe exist with non-zero status, no separate
|
# NOTE: We assume if tahoe exist with non-zero status, no separate
|
||||||
@ -410,7 +411,7 @@ class SystemTest (object):
|
|||||||
replace = 'false')
|
replace = 'false')
|
||||||
assert body.strip() == childcap, `status, dircap, childcap, childname`
|
assert body.strip() == childcap, `status, dircap, childcap, childname`
|
||||||
|
|
||||||
def polling_operation(self, operation, timeout = 10.0, pollinterval = 0.2):
|
def polling_operation(self, operation, polldesc, timeout = 10.0, pollinterval = 0.2):
|
||||||
totaltime = timeout # Fudging for edge-case SetupFailure description...
|
totaltime = timeout # Fudging for edge-case SetupFailure description...
|
||||||
|
|
||||||
totalattempts = int(timeout / pollinterval)
|
totalattempts = int(timeout / pollinterval)
|
||||||
@ -444,9 +445,10 @@ class SystemTest (object):
|
|||||||
#print tmpl % (attempt+1, opdelay, realinterval)
|
#print tmpl % (attempt+1, opdelay, realinterval)
|
||||||
time.sleep(realinterval)
|
time.sleep(realinterval)
|
||||||
|
|
||||||
tmpl = 'Timeout after waiting for creation of introducer.furl.\n'
|
|
||||||
|
tmpl = 'Timeout while polling for: %s\n'
|
||||||
tmpl += 'Waited %.2f seconds (%d polls).'
|
tmpl += 'Waited %.2f seconds (%d polls).'
|
||||||
raise self.SetupFailure(tmpl, totaltime, attempt+1)
|
raise self.SetupFailure(tmpl, polldesc, totaltime, attempt+1)
|
||||||
|
|
||||||
def warn(self, tmpl, *args):
|
def warn(self, tmpl, *args):
|
||||||
print ('Test Warning: ' + tmpl) % args
|
print ('Test Warning: ' + tmpl) % args
|
||||||
|
Loading…
x
Reference in New Issue
Block a user