@@ -1488,16 +1488,19 @@ fn simple_neon_integration() {
1488
1488
// query for prometheus metrics
1489
1489
#[ cfg( feature = "monitoring_prom" ) ]
1490
1490
{
1491
- let prom_http_origin = format ! ( "http://{}" , prom_bind) ;
1492
- let client = reqwest:: blocking:: Client :: new ( ) ;
1493
- let res = client
1494
- . get ( & prom_http_origin)
1495
- . send ( )
1496
- . unwrap ( )
1497
- . text ( )
1498
- . unwrap ( ) ;
1499
- let expected_result = format ! ( "stacks_node_stacks_tip_height {block_height_pre_3_0}" ) ;
1500
- assert ! ( res. contains( & expected_result) ) ;
1491
+ wait_for ( 10 , || {
1492
+ let prom_http_origin = format ! ( "http://{}" , prom_bind) ;
1493
+ let client = reqwest:: blocking:: Client :: new ( ) ;
1494
+ let res = client
1495
+ . get ( & prom_http_origin)
1496
+ . send ( )
1497
+ . unwrap ( )
1498
+ . text ( )
1499
+ . unwrap ( ) ;
1500
+ let expected_result = format ! ( "stacks_node_stacks_tip_height {block_height_pre_3_0}" ) ;
1501
+ Ok ( res. contains ( & expected_result) )
1502
+ } )
1503
+ . expect ( "Prometheus metrics did not update" ) ;
1501
1504
}
1502
1505
1503
1506
info ! ( "Nakamoto miner started..." ) ;
@@ -1599,19 +1602,30 @@ fn simple_neon_integration() {
1599
1602
let bhh = u64:: from ( tip. burn_header_height ) ;
1600
1603
test_observer:: contains_burn_block_range ( 220 ..=bhh) . unwrap ( ) ;
1601
1604
1602
- // make sure prometheus returns an updated height
1605
+ // make sure prometheus returns an updated number of processed blocks
1603
1606
#[ cfg( feature = "monitoring_prom" ) ]
1604
1607
{
1605
- let prom_http_origin = format ! ( "http://{}" , prom_bind) ;
1606
- let client = reqwest:: blocking:: Client :: new ( ) ;
1607
- let res = client
1608
- . get ( & prom_http_origin)
1609
- . send ( )
1610
- . unwrap ( )
1611
- . text ( )
1612
- . unwrap ( ) ;
1613
- let expected_result = format ! ( "stacks_node_stacks_tip_height {}" , tip. stacks_block_height) ;
1614
- assert ! ( res. contains( & expected_result) ) ;
1608
+ wait_for ( 10 , || {
1609
+ let prom_http_origin = format ! ( "http://{}" , prom_bind) ;
1610
+ let client = reqwest:: blocking:: Client :: new ( ) ;
1611
+ let res = client
1612
+ . get ( & prom_http_origin)
1613
+ . send ( )
1614
+ . unwrap ( )
1615
+ . text ( )
1616
+ . unwrap ( ) ;
1617
+ let expected_result_1 = format ! (
1618
+ "stacks_node_stx_blocks_processed_total {}" ,
1619
+ tip. stacks_block_height
1620
+ ) ;
1621
+
1622
+ let expected_result_2 = format ! (
1623
+ "stacks_node_stacks_tip_height {}" ,
1624
+ tip. stacks_block_height - 1
1625
+ ) ;
1626
+ Ok ( res. contains ( & expected_result_1) && res. contains ( & expected_result_2) )
1627
+ } )
1628
+ . expect ( "Prometheus metrics did not update" ) ;
1615
1629
}
1616
1630
1617
1631
check_nakamoto_empty_block_heuristics ( ) ;
0 commit comments