mirror of
https://github.com/tahoe-lafs/tahoe-lafs.git
synced 2025-02-08 12:20:19 +00:00
debug/test_cli: fix error handling for catalog-shares, to make the test stop failing on windows
This commit is contained in:
parent
b1db6d9ff2
commit
d97c34d622
@ -520,8 +520,11 @@ def call(c, *args, **kwargs):
|
|||||||
# take advantage of the fact that ImmediateReadBucketProxy returns
|
# take advantage of the fact that ImmediateReadBucketProxy returns
|
||||||
# Deferreds that are already fired
|
# Deferreds that are already fired
|
||||||
results = []
|
results = []
|
||||||
|
failures = []
|
||||||
d = defer.maybeDeferred(c, *args, **kwargs)
|
d = defer.maybeDeferred(c, *args, **kwargs)
|
||||||
d.addCallback(results.append)
|
d.addCallbacks(results.append, failures.append)
|
||||||
|
if failures:
|
||||||
|
failures[0].raiseException()
|
||||||
return results[0]
|
return results[0]
|
||||||
|
|
||||||
def describe_share(abs_sharefile, si_s, shnum_s, now, out):
|
def describe_share(abs_sharefile, si_s, shnum_s, now, out):
|
||||||
@ -580,7 +583,6 @@ def describe_share(abs_sharefile, si_s, shnum_s, now, out):
|
|||||||
elif struct.unpack(">L", prefix[:4]) == (1,):
|
elif struct.unpack(">L", prefix[:4]) == (1,):
|
||||||
# immutable
|
# immutable
|
||||||
|
|
||||||
|
|
||||||
class ImmediateReadBucketProxy(ReadBucketProxy):
|
class ImmediateReadBucketProxy(ReadBucketProxy):
|
||||||
def __init__(self, sf):
|
def __init__(self, sf):
|
||||||
self.sf = sf
|
self.sf = sf
|
||||||
@ -592,7 +594,7 @@ def describe_share(abs_sharefile, si_s, shnum_s, now, out):
|
|||||||
# use a ReadBucketProxy to parse the bucket and find the uri extension
|
# use a ReadBucketProxy to parse the bucket and find the uri extension
|
||||||
sf = storage.ShareFile(abs_sharefile)
|
sf = storage.ShareFile(abs_sharefile)
|
||||||
bp = ImmediateReadBucketProxy(sf)
|
bp = ImmediateReadBucketProxy(sf)
|
||||||
bp.start()
|
call(bp.start)
|
||||||
|
|
||||||
expiration_time = min( [lease.expiration_time
|
expiration_time = min( [lease.expiration_time
|
||||||
for lease in sf.iter_leases()] )
|
for lease in sf.iter_leases()] )
|
||||||
|
@ -244,7 +244,6 @@ class CLI(unittest.TestCase):
|
|||||||
self.failUnlessEqual(out, "", out)
|
self.failUnlessEqual(out, "", out)
|
||||||
self.failUnless("Error processing " in err, err)
|
self.failUnless("Error processing " in err, err)
|
||||||
self.failUnless(nodedir1 in err, err)
|
self.failUnless(nodedir1 in err, err)
|
||||||
self.flushLoggedErrors(AssertionError)
|
|
||||||
|
|
||||||
|
|
||||||
class CLITestMixin:
|
class CLITestMixin:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user