From 0c6df32f3fdf415b8244f352aca94e54d9597865 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Zoe=20Faltib=C3=A0?= Date: Wed, 13 Nov 2024 12:12:17 +0100 Subject: [PATCH] fix wallet::test::list_transactions::skip_sync --- src/wallet/test/list_transactions.rs | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/src/wallet/test/list_transactions.rs b/src/wallet/test/list_transactions.rs index 8276b20..5049291 100644 --- a/src/wallet/test/list_transactions.rs +++ b/src/wallet/test/list_transactions.rs @@ -107,6 +107,9 @@ fn success() { fn skip_sync() { initialize(); + let check_timeout = 10; + let check_interval = 1000; + let (wallet, online) = get_empty_wallet!(); send_to_address(test_get_address(&wallet)); @@ -116,7 +119,13 @@ fn skip_sync() { assert_eq!(transactions.len(), 0); // transaction list reports the TX after manually syncing - wallet.sync(online.clone()).unwrap(); - let transactions = test_list_transactions(&wallet, None); - assert_eq!(transactions.len(), 1); + assert!(wait_for_function( + || { + wallet.sync(online.clone()).unwrap(); + let transactions = test_list_transactions(&wallet, None); + transactions.len() == 1 + }, + check_timeout, + check_interval, + )); }