Skip to content

Commit b746bef

Browse files
committed
test: fix flakiness in nakamoto_lockup_events
1 parent e22e405 commit b746bef

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

testnet/stacks-node/src/tests/nakamoto_integrations.rs

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9645,12 +9645,14 @@ fn nakamoto_lockup_events() {
96459645
wait_for(30, || Ok(get_stacks_height() > height_before)).unwrap();
96469646
}
96479647

9648+
wait_for(30, || {
9649+
let blocks = test_observer::get_blocks();
9650+
let block = blocks.last().unwrap();
9651+
Ok(block.get("block_height").unwrap().as_u64().unwrap() == unlock_height)
9652+
})
9653+
.expect("Timed out waiting for test observer to reach unlock height");
96489654
let blocks = test_observer::get_blocks();
96499655
let block = blocks.last().unwrap();
9650-
assert_eq!(
9651-
block.get("block_height").unwrap().as_u64().unwrap(),
9652-
unlock_height
9653-
);
96549656

96559657
let events = block.get("events").unwrap().as_array().unwrap();
96569658
let mut found_event = false;

0 commit comments

Comments
 (0)