mirror of
https://github.com/serai-dex/serai.git
synced 2025-03-22 15:19:06 +00:00
Again tweak timeouts for #260
This commit is contained in:
parent
918cce3494
commit
55e0253225
5 changed files with 8 additions and 9 deletions
|
@ -48,7 +48,7 @@ async fn spend<C: Coin, D: Db>(
|
||||||
for _ in 0 .. C::CONFIRMATIONS {
|
for _ in 0 .. C::CONFIRMATIONS {
|
||||||
coin.mine_block().await;
|
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) => {
|
ScannerEvent::Outputs(this_key, _, outputs) => {
|
||||||
assert_eq!(this_key, key);
|
assert_eq!(this_key, key);
|
||||||
assert_eq!(outputs.len(), 1);
|
assert_eq!(outputs.len(), 1);
|
||||||
|
@ -81,7 +81,7 @@ pub async fn test_addresses<C: Coin>(coin: C) {
|
||||||
|
|
||||||
// Verify the Scanner picked them up
|
// Verify the Scanner picked them up
|
||||||
let outputs =
|
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) => {
|
ScannerEvent::Outputs(this_key, block, outputs) => {
|
||||||
assert_eq!(this_key, key);
|
assert_eq!(this_key, key);
|
||||||
assert_eq!(block, block_id);
|
assert_eq!(block, block_id);
|
||||||
|
|
|
@ -132,5 +132,4 @@ pub async fn test_key_gen<C: Coin>() {
|
||||||
panic!("didn't get key back");
|
panic!("didn't get key back");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
tokio::time::sleep(Duration::from_secs(1)).await;
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -45,7 +45,7 @@ pub async fn test_scanner<C: Coin>(coin: C) {
|
||||||
// Verify the Scanner picked them up
|
// Verify the Scanner picked them up
|
||||||
let verify_event = |mut scanner: ScannerHandle<C, MemDb>| async {
|
let verify_event = |mut scanner: ScannerHandle<C, MemDb>| async {
|
||||||
let outputs =
|
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) => {
|
ScannerEvent::Outputs(key, block, outputs) => {
|
||||||
assert_eq!(key, keys.group_key());
|
assert_eq!(key, keys.group_key());
|
||||||
assert_eq!(block, block_id);
|
assert_eq!(block, block_id);
|
||||||
|
@ -65,8 +65,8 @@ pub async fn test_scanner<C: Coin>(coin: C) {
|
||||||
assert_eq!(scanner.ack_block(keys.group_key(), block_id.clone()).await, outputs);
|
assert_eq!(scanner.ack_block(keys.group_key(), block_id.clone()).await, outputs);
|
||||||
|
|
||||||
// There should be no more events
|
// 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
|
// 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());
|
||||||
}
|
}
|
||||||
|
|
|
@ -117,7 +117,7 @@ pub async fn sign<C: Coin>(
|
||||||
}
|
}
|
||||||
for i in excluded {
|
for i in excluded {
|
||||||
assert!(timeout(
|
assert!(timeout(
|
||||||
Duration::from_secs(1),
|
Duration::from_secs(5),
|
||||||
signers.get_mut(&Participant::new(u16::try_from(i).unwrap()).unwrap()).unwrap().events.recv()
|
signers.get_mut(&Participant::new(u16::try_from(i).unwrap()).unwrap()).unwrap().events.recv()
|
||||||
)
|
)
|
||||||
.await
|
.await
|
||||||
|
|
|
@ -29,7 +29,7 @@ pub async fn test_wallet<C: Coin>(coin: C) {
|
||||||
|
|
||||||
let block_id = coin.test_send(C::address(key)).await.id();
|
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) => {
|
ScannerEvent::Outputs(this_key, block, outputs) => {
|
||||||
assert_eq!(this_key, key);
|
assert_eq!(this_key, key);
|
||||||
assert_eq!(block, block_id);
|
assert_eq!(block, block_id);
|
||||||
|
@ -95,7 +95,7 @@ pub async fn test_wallet<C: Coin>(coin: C) {
|
||||||
coin.mine_block().await;
|
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) => {
|
ScannerEvent::Outputs(this_key, block_id, these_outputs) => {
|
||||||
assert_eq!(this_key, key);
|
assert_eq!(this_key, key);
|
||||||
assert_eq!(block_id, block.id());
|
assert_eq!(block_id, block.id());
|
||||||
|
|
Loading…
Reference in a new issue