Skip to content

Commit 21e6a4e

Browse files
committed
fix: intermittent error in feature_notification due to extra CL
It can happen if the best block get CL too fast
1 parent 9c4e772 commit 21e6a4e

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

test/functional/feature_notifications.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,10 +109,15 @@ def run_test(self):
109109

110110
self.log.info("Mine single block, wait for chainlock")
111111
self.bump_mocktime(1)
112+
pre_tip = self.nodes[0].getbestblockhash()
112113
tip = self.generate(self.nodes[0], 1, sync_fun=self.no_op)[-1]
113114
self.wait_for_chainlocked_block_all_nodes(tip)
114115
# directory content should equal the chainlocked block hash
115-
assert_equal([tip], sorted(os.listdir(self.chainlocknotify_dir)))
116+
cl_hashes = sorted(os.listdir(self.chainlocknotify_dir))
117+
if len(cl_hashes) <= 1:
118+
assert_equal([tip], cl_hashes)
119+
else:
120+
assert_equal(sorted([tip, pre_tip]), cl_hashes)
116121

117122
if self.is_wallet_compiled():
118123
self.log.info("test -instantsendnotify")

0 commit comments

Comments
 (0)