From 6162c35e47d6e65c0bf18775d0e7191c73862686 Mon Sep 17 00:00:00 2001 From: Balaji Arun Date: Thu, 18 Jul 2024 16:52:36 -0700 Subject: [PATCH] [smoke-test][qs] add generate_traffic timeout to bad node --- .../consensus/quorum_store_fault_tolerance.rs | 29 ++++++++++--------- 1 file changed, 16 insertions(+), 13 deletions(-) diff --git a/testsuite/smoke-test/src/consensus/quorum_store_fault_tolerance.rs b/testsuite/smoke-test/src/consensus/quorum_store_fault_tolerance.rs index e1ad0f22ec38c..c1917685ae095 100644 --- a/testsuite/smoke-test/src/consensus/quorum_store_fault_tolerance.rs +++ b/testsuite/smoke-test/src/consensus/quorum_store_fault_tolerance.rs @@ -370,21 +370,24 @@ async fn test_swarm_with_bad_non_qs_node() { .unwrap(); info!("generate traffic"); - let tx_stat = generate_traffic( - &mut swarm, - &[dishonest_peer_id], - Duration::from_secs(20), - 1, - vec![vec![ - (TransactionTypeArg::CoinTransfer.materialize_default(), 70), - ( - TransactionTypeArg::AccountGeneration.materialize_default(), - 20, - ), - ]], + let tx_stat = tokio::time::timeout( + Duration::from_secs(60), + generate_traffic( + &mut swarm, + &[dishonest_peer_id], + Duration::from_secs(20), + 1, + vec![vec![ + (TransactionTypeArg::CoinTransfer.materialize_default(), 70), + ( + TransactionTypeArg::AccountGeneration.materialize_default(), + 20, + ), + ]], + ), ) .await; - assert!(tx_stat.is_err()); + assert!(tx_stat.is_err() || tx_stat.is_ok_and(|result| result.is_err())); generate_traffic_and_assert_committed( &mut swarm,