Skip to content

Commit 576fd41

Browse files
committed
fix: use wait_for to wait for metrics response to catch up
1 parent 2c8b270 commit 576fd41

File tree

1 file changed

+13
-8
lines changed

1 file changed

+13
-8
lines changed

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

Lines changed: 13 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1606,14 +1606,19 @@ fn simple_neon_integration() {
16061606
{
16071607
let prom_http_origin = format!("http://{}", prom_bind);
16081608
let client = reqwest::blocking::Client::new();
1609-
let res = client
1610-
.get(&prom_http_origin)
1611-
.send()
1612-
.unwrap()
1613-
.text()
1614-
.unwrap();
1615-
let expected_result = format!("stacks_node_stacks_tip_height {}", tip.stacks_block_height);
1616-
assert!(res.contains(&expected_result));
1609+
let info = get_chain_info_result(&naka_conf).unwrap();
1610+
let stacks_tip_height = info.stacks_tip_height;
1611+
wait_for(10, || {
1612+
let res = client
1613+
.get(&prom_http_origin)
1614+
.send()
1615+
.unwrap()
1616+
.text()
1617+
.unwrap();
1618+
let expected_result = format!("stacks_node_stacks_tip_height {}", stacks_tip_height);
1619+
Ok(res.contains(&expected_result))
1620+
})
1621+
.expect("Timed out waiting for updated stacks tip height in prometheus metrics");
16171622
}
16181623

16191624
check_nakamoto_empty_block_heuristics();

0 commit comments

Comments
 (0)