The issue was the 10s timeouts were too fast for the CI runner, since the
Scanner only polls every five seconds (already cutting into the window).
This commit is contained in:
Luke Parker
2023-03-17 21:38:09 -04:00
parent 0525ba2f62
commit 6ac570365f
4 changed files with 14 additions and 7 deletions

View File

@@ -48,7 +48,7 @@ async fn spend<C: Coin, D: Db>(
for _ in 0 .. C::CONFIRMATIONS {
coin.mine_block().await;
}
match timeout(Duration::from_secs(10), scanner.events.recv()).await.unwrap().unwrap() {
match timeout(Duration::from_secs(20), 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<C: Coin>(coin: C) {
// Verify the Scanner picked them up
let outputs =
match timeout(Duration::from_secs(10), scanner.events.recv()).await.unwrap().unwrap() {
match timeout(Duration::from_secs(20), scanner.events.recv()).await.unwrap().unwrap() {
ScannerEvent::Outputs(this_key, block, outputs) => {
assert_eq!(this_key, key);
assert_eq!(block, block_id);

View File

@@ -45,7 +45,7 @@ pub async fn test_scanner<C: Coin>(coin: C) {
// Verify the Scanner picked them up
let verify_event = |mut scanner: ScannerHandle<C, MemDb>| async {
let outputs =
match timeout(Duration::from_secs(10), scanner.events.recv()).await.unwrap().unwrap() {
match timeout(Duration::from_secs(20), 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<C: Coin>(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(10), scanner.events.recv()).await.is_err());
assert!(timeout(Duration::from_secs(20), 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(10), new_scanner().await.events.recv()).await.is_err());
assert!(timeout(Duration::from_secs(20), new_scanner().await.events.recv()).await.is_err());
}

View File

@@ -29,7 +29,7 @@ pub async fn test_wallet<C: Coin>(coin: C) {
let block_id = coin.test_send(C::address(key)).await.id();
match timeout(Duration::from_secs(10), scanner.events.recv()).await.unwrap().unwrap() {
match timeout(Duration::from_secs(20), 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<C: Coin>(coin: C) {
coin.mine_block().await;
}
match timeout(Duration::from_secs(10), scanner.events.recv()).await.unwrap().unwrap() {
match timeout(Duration::from_secs(20), 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());