@@ -1500,16 +1500,19 @@ fn simple_neon_integration() {
1500
1500
// query for prometheus metrics
1501
1501
#[ cfg( feature = "monitoring_prom" ) ]
1502
1502
{
1503
- let prom_http_origin = format ! ( "http://{}" , prom_bind) ;
1504
- let client = reqwest:: blocking:: Client :: new ( ) ;
1505
- let res = client
1506
- . get ( & prom_http_origin)
1507
- . send ( )
1508
- . unwrap ( )
1509
- . text ( )
1510
- . unwrap ( ) ;
1511
- let expected_result = format ! ( "stacks_node_stacks_tip_height {block_height_pre_3_0}" ) ;
1512
- assert ! ( res. contains( & expected_result) ) ;
1503
+ wait_for ( 10 , || {
1504
+ let prom_http_origin = format ! ( "http://{}" , prom_bind) ;
1505
+ let client = reqwest:: blocking:: Client :: new ( ) ;
1506
+ let res = client
1507
+ . get ( & prom_http_origin)
1508
+ . send ( )
1509
+ . unwrap ( )
1510
+ . text ( )
1511
+ . unwrap ( ) ;
1512
+ let expected_result = format ! ( "stacks_node_stacks_tip_height {block_height_pre_3_0}" ) ;
1513
+ Ok ( res. contains ( & expected_result) )
1514
+ } )
1515
+ . expect ( "Prometheus metrics did not update" ) ;
1513
1516
}
1514
1517
1515
1518
info ! ( "Nakamoto miner started..." ) ;
@@ -1621,16 +1624,27 @@ fn simple_neon_integration() {
1621
1624
// make sure prometheus returns an updated number of processed blocks
1622
1625
#[ cfg( feature = "monitoring_prom" ) ]
1623
1626
{
1624
- let prom_http_origin = format ! ( "http://{}" , prom_bind) ;
1625
- let client = reqwest:: blocking:: Client :: new ( ) ;
1626
- let res = client
1627
- . get ( & prom_http_origin)
1628
- . send ( )
1629
- . unwrap ( )
1630
- . text ( )
1631
- . unwrap ( ) ;
1632
- let expected_result = format ! ( "stacks_node_stacks_tip_height {}" , tip. stacks_block_height) ;
1633
- assert ! ( res. contains( & expected_result) ) ;
1627
+ wait_for ( 10 , || {
1628
+ let prom_http_origin = format ! ( "http://{}" , prom_bind) ;
1629
+ let client = reqwest:: blocking:: Client :: new ( ) ;
1630
+ let res = client
1631
+ . get ( & prom_http_origin)
1632
+ . send ( )
1633
+ . unwrap ( )
1634
+ . text ( )
1635
+ . unwrap ( ) ;
1636
+ let expected_result_1 = format ! (
1637
+ "stacks_node_stx_blocks_processed_total {}" ,
1638
+ tip. stacks_block_height
1639
+ ) ;
1640
+
1641
+ let expected_result_2 = format ! (
1642
+ "stacks_node_stacks_tip_height {}" ,
1643
+ tip. stacks_block_height - 1
1644
+ ) ;
1645
+ Ok ( res. contains ( & expected_result_1) && res. contains ( & expected_result_2) )
1646
+ } )
1647
+ . expect ( "Prometheus metrics did not update" ) ;
1634
1648
}
1635
1649
1636
1650
check_nakamoto_empty_block_heuristics ( ) ;
@@ -6360,15 +6374,18 @@ fn signer_chainstate() {
6360
6374
. unwrap ( )
6361
6375
. stacks_block_height ;
6362
6376
let prom_http_origin = format ! ( "http://{}" , prom_bind) ;
6363
- let client = reqwest:: blocking:: Client :: new ( ) ;
6364
- let res = client
6365
- . get ( & prom_http_origin)
6366
- . send ( )
6367
- . unwrap ( )
6368
- . text ( )
6369
- . unwrap ( ) ;
6370
- let expected_result = format ! ( "stacks_node_stacks_tip_height {block_height_pre_3_0}" ) ;
6371
- assert ! ( res. contains( & expected_result) ) ;
6377
+ wait_for ( 10 , || {
6378
+ let client = reqwest:: blocking:: Client :: new ( ) ;
6379
+ let res = client
6380
+ . get ( & prom_http_origin)
6381
+ . send ( )
6382
+ . unwrap ( )
6383
+ . text ( )
6384
+ . unwrap ( ) ;
6385
+ let expected_result = format ! ( "stacks_node_stacks_tip_height {block_height_pre_3_0}" ) ;
6386
+ Ok ( res. contains ( & expected_result) )
6387
+ } )
6388
+ . expect ( "Failed waiting for prometheus metrics to update" )
6372
6389
}
6373
6390
6374
6391
info ! ( "Nakamoto miner started..." ) ;
@@ -6972,15 +6989,18 @@ fn continue_tenure_extend() {
6972
6989
#[ cfg( feature = "monitoring_prom" ) ]
6973
6990
{
6974
6991
let prom_http_origin = format ! ( "http://{}" , prom_bind) ;
6975
- let client = reqwest:: blocking:: Client :: new ( ) ;
6976
- let res = client
6977
- . get ( & prom_http_origin)
6978
- . send ( )
6979
- . unwrap ( )
6980
- . text ( )
6981
- . unwrap ( ) ;
6982
- let expected_result = format ! ( "stacks_node_stacks_tip_height {block_height_pre_3_0}" ) ;
6983
- assert ! ( res. contains( & expected_result) ) ;
6992
+ wait_for ( 10 , || {
6993
+ let client = reqwest:: blocking:: Client :: new ( ) ;
6994
+ let res = client
6995
+ . get ( & prom_http_origin)
6996
+ . send ( )
6997
+ . unwrap ( )
6998
+ . text ( )
6999
+ . unwrap ( ) ;
7000
+ let expected_result = format ! ( "stacks_node_stacks_tip_height {block_height_pre_3_0}" ) ;
7001
+ Ok ( res. contains ( & expected_result) )
7002
+ } )
7003
+ . expect ( "Prometheus metrics did not update" ) ;
6984
7004
}
6985
7005
6986
7006
info ! ( "Nakamoto miner started..." ) ;
0 commit comments