From 55e02532255af07237ecbcc61517035a4ee1608a Mon Sep 17 00:00:00 2001 From: Luke Parker Date: Fri, 17 Mar 2023 23:45:46 -0400 Subject: [PATCH] Again tweak timeouts for #260 --- processor/src/tests/addresses.rs | 4 ++-- processor/src/tests/key_gen.rs | 1 - processor/src/tests/scanner.rs | 6 +++--- processor/src/tests/signer.rs | 2 +- processor/src/tests/wallet.rs | 4 ++-- 5 files changed, 8 insertions(+), 9 deletions(-) diff --git a/processor/src/tests/addresses.rs b/processor/src/tests/addresses.rs index 2999623e..10310f90 100644 --- a/processor/src/tests/addresses.rs +++ b/processor/src/tests/addresses.rs @@ -48,7 +48,7 @@ async fn spend( for _ in 0 .. C::CONFIRMATIONS { coin.mine_block().await; } - match timeout(Duration::from_secs(20), scanner.events.recv()).await.unwrap().unwrap() { + match timeout(Duration::from_secs(30), scanner.events.recv()).await.unwrap().unwrap() { ScannerEvent::Outputs(this_key, _, outputs) => { assert_eq!(this_key, key); assert_eq!(outputs.len(), 1); @@ -81,7 +81,7 @@ pub async fn test_addresses(coin: C) { // Verify the Scanner picked them up let outputs = - match timeout(Duration::from_secs(20), scanner.events.recv()).await.unwrap().unwrap() { + match timeout(Duration::from_secs(30), scanner.events.recv()).await.unwrap().unwrap() { ScannerEvent::Outputs(this_key, block, outputs) => { assert_eq!(this_key, key); assert_eq!(block, block_id); diff --git a/processor/src/tests/key_gen.rs b/processor/src/tests/key_gen.rs index 19cf2e4f..6e11da13 100644 --- a/processor/src/tests/key_gen.rs +++ b/processor/src/tests/key_gen.rs @@ -132,5 +132,4 @@ pub async fn test_key_gen() { panic!("didn't get key back"); } } - tokio::time::sleep(Duration::from_secs(1)).await; } diff --git a/processor/src/tests/scanner.rs b/processor/src/tests/scanner.rs index bbb7d3b7..22b4987e 100644 --- a/processor/src/tests/scanner.rs +++ b/processor/src/tests/scanner.rs @@ -45,7 +45,7 @@ pub async fn test_scanner(coin: C) { // Verify the Scanner picked them up let verify_event = |mut scanner: ScannerHandle| async { let outputs = - match timeout(Duration::from_secs(20), scanner.events.recv()).await.unwrap().unwrap() { + match timeout(Duration::from_secs(30), scanner.events.recv()).await.unwrap().unwrap() { ScannerEvent::Outputs(key, block, outputs) => { assert_eq!(key, keys.group_key()); assert_eq!(block, block_id); @@ -65,8 +65,8 @@ pub async fn test_scanner(coin: C) { assert_eq!(scanner.ack_block(keys.group_key(), block_id.clone()).await, outputs); // There should be no more events - assert!(timeout(Duration::from_secs(20), scanner.events.recv()).await.is_err()); + assert!(timeout(Duration::from_secs(30), scanner.events.recv()).await.is_err()); // Create a new scanner off the current DB and make sure it also does nothing - assert!(timeout(Duration::from_secs(20), new_scanner().await.events.recv()).await.is_err()); + assert!(timeout(Duration::from_secs(30), new_scanner().await.events.recv()).await.is_err()); } diff --git a/processor/src/tests/signer.rs b/processor/src/tests/signer.rs index 6f9372e3..6fdd1c04 100644 --- a/processor/src/tests/signer.rs +++ b/processor/src/tests/signer.rs @@ -117,7 +117,7 @@ pub async fn sign( } for i in excluded { assert!(timeout( - Duration::from_secs(1), + Duration::from_secs(5), signers.get_mut(&Participant::new(u16::try_from(i).unwrap()).unwrap()).unwrap().events.recv() ) .await diff --git a/processor/src/tests/wallet.rs b/processor/src/tests/wallet.rs index 23b4bc60..85171d74 100644 --- a/processor/src/tests/wallet.rs +++ b/processor/src/tests/wallet.rs @@ -29,7 +29,7 @@ pub async fn test_wallet(coin: C) { let block_id = coin.test_send(C::address(key)).await.id(); - match timeout(Duration::from_secs(20), scanner.events.recv()).await.unwrap().unwrap() { + match timeout(Duration::from_secs(30), scanner.events.recv()).await.unwrap().unwrap() { ScannerEvent::Outputs(this_key, block, outputs) => { assert_eq!(this_key, key); assert_eq!(block, block_id); @@ -95,7 +95,7 @@ pub async fn test_wallet(coin: C) { coin.mine_block().await; } - match timeout(Duration::from_secs(20), scanner.events.recv()).await.unwrap().unwrap() { + match timeout(Duration::from_secs(30), scanner.events.recv()).await.unwrap().unwrap() { ScannerEvent::Outputs(this_key, block_id, these_outputs) => { assert_eq!(this_key, key); assert_eq!(block_id, block.id());