فهرست منبع

Add `sleep` in test

Cesar Rodas 2 ماه پیش
والد
کامیت
ea9f20481a
1فایلهای تغییر یافته به همراه4 افزوده شده و 0 حذف شده
  1. 4 0
      crates/cdk-integration-tests/tests/integration_tests_pure.rs

+ 4 - 0
crates/cdk-integration-tests/tests/integration_tests_pure.rs

@@ -8,6 +8,7 @@ use std::assert_eq;
 use std::collections::{HashMap, HashSet};
 use std::hash::RandomState;
 use std::str::FromStr;
+use std::time::Duration;
 
 use cashu::amount::SplitTarget;
 use cashu::dhke::construct_proofs;
@@ -24,6 +25,7 @@ use cdk::wallet::{ReceiveOptions, SendMemo, SendOptions};
 use cdk::Amount;
 use cdk_fake_wallet::create_fake_invoice;
 use cdk_integration_tests::init_pure_tests::*;
+use tokio::time::sleep;
 
 /// Tests the token swap and send functionality:
 /// 1. Alice gets funded with 64 sats
@@ -496,6 +498,8 @@ pub async fn test_p2pk_swap() {
 
     assert!(attempt_swap.is_ok());
 
+    sleep(Duration::from_secs(1)).await;
+
     let mut msgs = HashMap::new();
     while let Ok((sub_id, msg)) = listener.try_recv() {
         assert_eq!(sub_id, "test".into());