mirror of
https://github.com/aljazceru/lightning.git
synced 2025-12-19 23:24:27 +01:00
testing: make sure we don't see gossip in bad order.
This is something which generally shouldn't happen, but we didn't notice it previously. We ignore this warning in the case where a channel was deleted: this happens because one side can send an update while the other notices that the channel is closed. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
This commit is contained in:
committed by
Christian Decker
parent
177a1fc88e
commit
8ee60e2d8e
@@ -299,6 +299,13 @@ class BaseLightningDTests(unittest.TestCase):
|
||||
return 1
|
||||
return 0
|
||||
|
||||
def checkBadGossipOrder(self, node):
|
||||
# We can have a race where we notice a channel deleted and someone
|
||||
# sends an update.
|
||||
if node.daemon.is_in_log('Bad gossip order') and not node.daemon.is_in_log('Deleting channel'):
|
||||
return 1
|
||||
return 0
|
||||
|
||||
def tearDown(self):
|
||||
ok = self.node_factory.killall([not n.may_fail for n in self.node_factory.nodes])
|
||||
self.executor.shutdown(wait=False)
|
||||
@@ -322,6 +329,11 @@ class BaseLightningDTests(unittest.TestCase):
|
||||
if err_count:
|
||||
raise ValueError("{} nodes had unexpected reconnections".format(err_count))
|
||||
|
||||
for node in self.node_factory.nodes:
|
||||
err_count += self.checkBadGossipOrder(node)
|
||||
if err_count:
|
||||
raise ValueError("{} nodes had bad gossip order".format(err_count))
|
||||
|
||||
if not ok:
|
||||
raise Exception("At least one lightning exited with unexpected non-zero return code")
|
||||
|
||||
|
||||
Reference in New Issue
Block a user