@@ -3952,6 +3952,7 @@ fn locally_accepted_blocks_overriden_by_global_rejection() {
3952
3952
let send_fee = 180 ;
3953
3953
let nmb_txs = 2 ;
3954
3954
let recipient = PrincipalData :: from ( StacksAddress :: burn_address ( false ) ) ;
3955
+ let short_timeout_secs = 20 ;
3955
3956
let mut signer_test: SignerTest < SpawnedSigner > = SignerTest :: new (
3956
3957
num_signers,
3957
3958
vec ! [ ( sender_addr. clone( ) , ( send_amt + send_fee) * nmb_txs) ] ,
@@ -3976,7 +3977,7 @@ fn locally_accepted_blocks_overriden_by_global_rejection() {
3976
3977
make_stacks_transfer ( & sender_sk, sender_nonce, send_fee, & recipient, send_amt) ;
3977
3978
let tx = submit_tx ( & http_origin, & transfer_tx) ;
3978
3979
info ! ( "Submitted tx {tx} in to mine block N" ) ;
3979
- wait_for ( 30 , || {
3980
+ wait_for ( short_timeout_secs , || {
3980
3981
Ok ( mined_blocks. load ( Ordering :: SeqCst ) > blocks_before
3981
3982
&& signer_test
3982
3983
. stacks_client
@@ -3996,7 +3997,11 @@ fn locally_accepted_blocks_overriden_by_global_rejection() {
3996
3997
let block_n = nakamoto_blocks. last ( ) . unwrap ( ) ;
3997
3998
assert_eq ! ( info_after. stacks_tip. to_string( ) , block_n. block_hash) ;
3998
3999
signer_test
3999
- . wait_for_block_acceptance ( 30 , & block_n. signer_signature_hash , & all_signers)
4000
+ . wait_for_block_acceptance (
4001
+ short_timeout_secs,
4002
+ & block_n. signer_signature_hash ,
4003
+ & all_signers,
4004
+ )
4000
4005
. expect ( "Timed out waiting for block acceptance of N" ) ;
4001
4006
4002
4007
info ! ( "------------------------- Attempt to Mine Nakamoto Block N+1 -------------------------" ) ;
@@ -4014,8 +4019,9 @@ fn locally_accepted_blocks_overriden_by_global_rejection() {
4014
4019
4015
4020
let blocks_before = mined_blocks. load ( Ordering :: SeqCst ) ;
4016
4021
let info_before = signer_test. stacks_client . get_peer_info ( ) . unwrap ( ) ;
4022
+ // We cannot gaurantee that ALL signers will reject due to the testing directive as we may hit majority first..So ensure that we only assert that up to the threshold number rejected
4017
4023
signer_test
4018
- . wait_for_block_rejections ( 60 , & rejecting_signers, Some ( RejectCode :: TestingDirective ) )
4024
+ . wait_for_block_rejections ( short_timeout_secs , & rejecting_signers)
4019
4025
. expect ( "Timed out waiting for block rejection of N+1" ) ;
4020
4026
4021
4027
assert_eq ! ( blocks_before, mined_blocks. load( Ordering :: SeqCst ) ) ;
@@ -4032,7 +4038,7 @@ fn locally_accepted_blocks_overriden_by_global_rejection() {
4032
4038
. lock ( )
4033
4039
. unwrap ( )
4034
4040
. replace ( Vec :: new ( ) ) ;
4035
- wait_for ( 30 , || {
4041
+ wait_for ( short_timeout_secs , || {
4036
4042
Ok ( mined_blocks. load ( Ordering :: SeqCst ) > blocks_before
4037
4043
&& signer_test
4038
4044
. stacks_client
@@ -4061,7 +4067,11 @@ fn locally_accepted_blocks_overriden_by_global_rejection() {
4061
4067
assert_ne ! ( block_n_1_prime, block_n_1) ;
4062
4068
// Verify that all signers accepted the new block proposal
4063
4069
signer_test
4064
- . wait_for_block_acceptance ( 30 , & block_n_1_prime. signer_signature_hash , & all_signers)
4070
+ . wait_for_block_acceptance (
4071
+ short_timeout_secs,
4072
+ & block_n_1_prime. signer_signature_hash ,
4073
+ & all_signers,
4074
+ )
4065
4075
. expect ( "Timed out waiting for block acceptance of N+1'" ) ;
4066
4076
}
4067
4077
@@ -4195,11 +4205,7 @@ fn locally_rejected_blocks_overriden_by_global_acceptance() {
4195
4205
. expect ( "Timed out waiting for stacks block N+1 to be mined" ) ;
4196
4206
4197
4207
signer_test
4198
- . wait_for_block_rejections (
4199
- short_timeout,
4200
- & rejecting_signers,
4201
- Some ( RejectCode :: TestingDirective ) ,
4202
- )
4208
+ . wait_for_block_rejections ( short_timeout, & rejecting_signers)
4203
4209
. expect ( "Timed out waiting for block rejection of N+1" ) ;
4204
4210
4205
4211
// Assert the block was mined
0 commit comments