Skip to content

Commit 16fcb7a

Browse files
Merge #6672: fix: intermittent error in feature_notification due to extra CL
21e6a4e fix: intermittent error in feature_notification due to extra CL (Konstantin Akimov) Pull request description: ## Issue being fixed or feature implemented It can happen if the best block get CL too fast. Locally it fails 1 time out of 10 with error: 2025-05-16T07:09:24.060000Z TestFramework (INFO): Mine single block, wait for chainlock 2025-05-16T07:09:24.275000Z TestFramework (ERROR): Assertion failed Traceback (most recent call last): File "DASH/test/functional/test_framework/test_framework.py", line 162, in main self.run_test() File "DASH/test/functional/feature_notifications.py", line 121, in run_test assert_equal([tip], sorted(os.listdir(self.chainlocknotify_dir))) File "DASH/test/functional/test_framework/util.py", line 69, in assert_equal raise AssertionError("not(%s)" % " == ".join(str(arg) for arg in (thing1, thing2) + args)) AssertionError: not(['21b88334ae6fc29ee3bb7c89dd760dad5dc8ce1064db370dc697b3da4c4315e0'] == ['21b88334ae6fc29ee3bb7c89dd760dad5dc8ce1064db370dc697b3da4c4315e0', '4fe83a613290bd755fba25da02f493376a96971b119884831a75cea33032718d']) 2025-05-16T07:09:24.326000Z TestFramework (INFO): Stopping nodes ## What was done? We should expect CL not only for tip but for block before tip, if CL has been formed really fast. ## How Has This Been Tested? Run feature_notifications.py multiple times with these extra changes #6671 ## Breaking Changes N/A ## Checklist: - [x] I have performed a self-review of my own code - [ ] I have commented my code, particularly in hard-to-understand areas - [ ] I have added or updated relevant unit/integration/functional/e2e tests - [ ] I have made corresponding changes to the documentation - [x] I have assigned this pull request to a milestone ACKs for top commit: UdjinM6: utACK 21e6a4e PastaPastaPasta: utACK 21e6a4e Tree-SHA512: 552ba9f25c7ef15ea7392b90f4d57577b7a9b2ab088325f7ba817d091be54e9d8b3d39129e73cff391ade5ddeb52af877575dfbc428b704931a412c619f08523
2 parents 981c2f8 + 21e6a4e commit 16fcb7a

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
@@ -115,10 +115,15 @@ def run_test(self):
115115

116116
self.log.info("Mine single block, wait for chainlock")
117117
self.bump_mocktime(1)
118+
pre_tip = self.nodes[0].getbestblockhash()
118119
tip = self.generate(self.nodes[0], 1, sync_fun=self.no_op)[-1]
119120
self.wait_for_chainlocked_block_all_nodes(tip)
120121
# directory content should equal the chainlocked block hash
121-
assert_equal([tip], sorted(os.listdir(self.chainlocknotify_dir)))
122+
cl_hashes = sorted(os.listdir(self.chainlocknotify_dir))
123+
if len(cl_hashes) <= 1:
124+
assert_equal([tip], cl_hashes)
125+
else:
126+
assert_equal(sorted([tip, pre_tip]), cl_hashes)
122127

123128
if self.is_wallet_compiled():
124129
self.log.info("test -instantsendnotify")

0 commit comments

Comments
 (0)