From dc7d6a99fda83fef276c6c9f8d419390852bf641 Mon Sep 17 00:00:00 2001 From: Sishan Long Date: Tue, 3 Sep 2024 13:33:31 -0700 Subject: [PATCH] sleep adjust and pending condition --- crates/marketplace/src/testing/order_test.rs | 23 ++++++-------------- 1 file changed, 7 insertions(+), 16 deletions(-) diff --git a/crates/marketplace/src/testing/order_test.rs b/crates/marketplace/src/testing/order_test.rs index 31676aa1..f5b61ec8 100644 --- a/crates/marketplace/src/testing/order_test.rs +++ b/crates/marketplace/src/testing/order_test.rs @@ -333,7 +333,6 @@ async fn test_builder_order_chain_fork() { .broadcast(req_msg.2.clone()) .await .unwrap(); - async_sleep(Duration::from_millis(100)).await; // get response // in the next round we will use received transactions to simulate @@ -362,7 +361,6 @@ async fn test_builder_order_chain_fork() { .broadcast(req_msg_2.2.clone()) .await .unwrap(); - async_sleep(Duration::from_millis(100)).await; // get response let res_msg_2 = req_msg_2 @@ -402,21 +400,14 @@ async fn test_builder_order_chain_fork() { } } - // we should've served all transactions submitted, and in correct order + // the test will fail if any transaction is re-ordered + assert!(order_check(transaction_history, all_transactions.clone())); + assert!(order_check(transaction_history_2, all_transactions)); // the test will fail if any transaction is skipped or re-ordered - async_sleep(Duration::from_millis(500)).await; - assert_eq!( - transaction_history, - all_transactions - .clone() - .into_iter() - .flatten() - .collect::>() - ); - assert_eq!( - transaction_history_2, - all_transactions.into_iter().flatten().collect::>() - ); + // assert_eq!( + // transaction_history_2, + // all_transactions.into_iter().flatten().collect::>() + // ); } /// This test simulates multiple builder states receiving messages from the channels and processing them