File tree Expand file tree Collapse file tree 1 file changed +10
-3
lines changed
testnet/stacks-node/src/tests/signer Expand file tree Collapse file tree 1 file changed +10
-3
lines changed Original file line number Diff line number Diff line change @@ -558,16 +558,23 @@ fn miner_gather_signatures() {
558
558
// Test prometheus metrics response
559
559
#[ cfg( feature = "monitoring_prom" ) ]
560
560
{
561
+ let naka_blocks_confirmed = signer_test
562
+ . running_nodes
563
+ . nakamoto_blocks_mined
564
+ . load ( Ordering :: SeqCst ) ;
565
+ info ! ( "Nakamoto blocks confirmed: {}" , naka_blocks_confirmed) ;
561
566
let metrics_response = signer_test. get_signer_metrics ( ) ;
562
567
568
+ let expected_blocks = ( naka_blocks_confirmed as usize ) * num_signers;
569
+
563
570
// Because 5 signers are running in the same process, the prometheus metrics
564
571
// are incremented once for every signer. This is why we expect the metric to be
565
- // `5`, even though there is only one block proposed .
566
- let expected_result = format ! ( "stacks_signer_block_proposals_received {}" , num_signers ) ;
572
+ // `5` * `naka_blocks_confirmed` .
573
+ let expected_result = format ! ( "stacks_signer_block_proposals_received {}" , expected_blocks ) ;
567
574
assert ! ( metrics_response. contains( & expected_result) ) ;
568
575
let expected_result = format ! (
569
576
"stacks_signer_block_responses_sent{{response_type=\" accepted\" }} {}" ,
570
- num_signers
577
+ expected_blocks
571
578
) ;
572
579
assert ! ( metrics_response. contains( & expected_result) ) ;
573
580
}
You can’t perform that action at this time.
0 commit comments