@@ -231,27 +231,20 @@ impl SignerTest<SpawnedSigner> {
231
231
Some ( self . num_stacking_cycles ) ,
232
232
) ;
233
233
info ! ( "Waiting for signer set calculation." ) ;
234
- let mut reward_set_calculated = false ;
235
- let short_timeout = Duration :: from_secs ( 60 ) ;
236
- let now = std:: time:: Instant :: now ( ) ;
237
234
// Make sure the signer set is calculated before continuing or signers may not
238
235
// recognize that they are registered signers in the subsequent burn block event
239
236
let reward_cycle = self . get_current_reward_cycle ( ) + 1 ;
240
- while !reward_set_calculated {
241
- let reward_set = self
237
+ wait_for ( 30 , || {
238
+ Ok ( self
242
239
. stacks_client
243
240
. get_reward_set_signers ( reward_cycle)
244
- . expect ( "Failed to check if reward set is calculated" ) ;
245
- reward_set_calculated = reward_set. is_some ( ) ;
246
- if reward_set_calculated {
247
- debug ! ( "Signer set: {:?}" , reward_set. unwrap( ) ) ;
248
- }
249
- std:: thread:: sleep ( Duration :: from_secs ( 1 ) ) ;
250
- assert ! (
251
- now. elapsed( ) < short_timeout,
252
- "Timed out waiting for reward set calculation"
253
- ) ;
254
- }
241
+ . expect ( "Failed to check if reward set is calculated" )
242
+ . map ( |reward_set| {
243
+ debug ! ( "Signer set: {:?}" , reward_set) ;
244
+ } )
245
+ . is_some ( ) )
246
+ } )
247
+ . expect ( "Timed out waiting for reward set calculation" ) ;
255
248
info ! ( "Signer set calculated" ) ;
256
249
257
250
// Manually consume one more block to ensure signers refresh their state
@@ -264,8 +257,7 @@ impl SignerTest<SpawnedSigner> {
264
257
info ! ( "Signers initialized" ) ;
265
258
266
259
self . run_until_epoch_3_boundary ( ) ;
267
- std:: thread:: sleep ( Duration :: from_secs ( 1 ) ) ;
268
- wait_for ( 60 , || {
260
+ wait_for ( 30 , || {
269
261
Ok ( get_chain_info_opt ( & self . running_nodes . conf ) . is_some ( ) )
270
262
} )
271
263
. expect ( "Timed out waiting for network to restart after 3.0 boundary reached" ) ;
@@ -275,11 +267,11 @@ impl SignerTest<SpawnedSigner> {
275
267
// could be other miners mining blocks.
276
268
let height_before = get_chain_info ( & self . running_nodes . conf ) . stacks_tip_height ;
277
269
info ! ( "Waiting for first Nakamoto block: {}" , height_before + 1 ) ;
278
- next_block_and ( & mut self . running_nodes . btc_regtest_controller , 60 , || {
279
- let height = get_chain_info ( & self . running_nodes . conf ) . stacks_tip_height ;
280
- Ok ( height > height_before)
270
+ self . mine_nakamoto_block ( Duration :: from_secs ( 30 ) ) ;
271
+ wait_for ( 30 , || {
272
+ Ok ( get_chain_info ( & self . running_nodes . conf ) . stacks_tip_height > height_before)
281
273
} )
282
- . unwrap ( ) ;
274
+ . expect ( "Timed out waiting for first Nakamoto block after 3.0 boundary" ) ;
283
275
info ! ( "Ready to mine Nakamoto blocks!" ) ;
284
276
}
285
277
@@ -553,19 +545,9 @@ fn miner_gather_signatures() {
553
545
let num_signers = 5 ;
554
546
let mut signer_test: SignerTest < SpawnedSigner > = SignerTest :: new ( num_signers, vec ! [ ] ) ;
555
547
let timeout = Duration :: from_secs ( 30 ) ;
556
- let mined_blocks = signer_test. running_nodes . nakamoto_blocks_mined . clone ( ) ;
557
- let blocks_mined_before = mined_blocks. load ( Ordering :: SeqCst ) ;
558
548
559
549
signer_test. boot_to_epoch_3 ( ) ;
560
550
561
- // give the system a chance to reach the Nakamoto start tip
562
- // mine a Nakamoto block
563
- wait_for ( 30 , || {
564
- let blocks_mined = mined_blocks. load ( Ordering :: SeqCst ) ;
565
- Ok ( blocks_mined > blocks_mined_before)
566
- } )
567
- . unwrap ( ) ;
568
-
569
551
info ! ( "------------------------- Test Mine and Verify Confirmed Nakamoto Block -------------------------" ) ;
570
552
signer_test. mine_and_verify_confirmed_naka_block ( timeout, num_signers) ;
571
553
@@ -2317,7 +2299,7 @@ fn empty_sortition() {
2317
2299
let send_amt = 100 ;
2318
2300
let send_fee = 180 ;
2319
2301
let recipient = PrincipalData :: from ( StacksAddress :: burn_address ( false ) ) ;
2320
- let block_proposal_timeout = Duration :: from_secs ( 5 ) ;
2302
+ let block_proposal_timeout = Duration :: from_secs ( 20 ) ;
2321
2303
let mut signer_test: SignerTest < SpawnedSigner > = SignerTest :: new_with_config_modifications (
2322
2304
num_signers,
2323
2305
vec ! [ ( sender_addr. clone( ) , send_amt + send_fee) ] ,
0 commit comments