Skip to content

Commit

Permalink
fix: use wait_for to wait for metrics response to catch up
Browse files Browse the repository at this point in the history
  • Loading branch information
hstove committed Oct 7, 2024
1 parent 2c8b270 commit 576fd41
Showing 1 changed file with 13 additions and 8 deletions.
21 changes: 13 additions & 8 deletions testnet/stacks-node/src/tests/nakamoto_integrations.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1606,14 +1606,19 @@ fn simple_neon_integration() {
{
let prom_http_origin = format!("http://{}", prom_bind);
let client = reqwest::blocking::Client::new();
let res = client
.get(&prom_http_origin)
.send()
.unwrap()
.text()
.unwrap();
let expected_result = format!("stacks_node_stacks_tip_height {}", tip.stacks_block_height);
assert!(res.contains(&expected_result));
let info = get_chain_info_result(&naka_conf).unwrap();
let stacks_tip_height = info.stacks_tip_height;
wait_for(10, || {
let res = client
.get(&prom_http_origin)
.send()
.unwrap()
.text()
.unwrap();
let expected_result = format!("stacks_node_stacks_tip_height {}", stacks_tip_height);
Ok(res.contains(&expected_result))
})
.expect("Timed out waiting for updated stacks tip height in prometheus metrics");
}

check_nakamoto_empty_block_heuristics();
Expand Down

0 comments on commit 576fd41

Please sign in to comment.