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