From f53b2d2262c3c6a32c2d5597ad9011b701771178 Mon Sep 17 00:00:00 2001 From: ilya Date: Thu, 28 Nov 2024 18:36:06 +0000 Subject: [PATCH] Fix flaky e2e test (#3143) Fixes flaky e2e test by starting autopilot only once all the orders are created. Locally, these failures are almost impossible to reproduce since all the orders, in most cases, belong to a single auction, while this is not the case on CI. --- crates/e2e/tests/e2e/limit_orders.rs | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/crates/e2e/tests/e2e/limit_orders.rs b/crates/e2e/tests/e2e/limit_orders.rs index 722ceaa6d4..e07c827cbb 100644 --- a/crates/e2e/tests/e2e/limit_orders.rs +++ b/crates/e2e/tests/e2e/limit_orders.rs @@ -361,15 +361,6 @@ async fn two_limit_orders_multiple_winners_test(web3: Web3) { ); let services = Services::new(&onchain).await; - services.start_autopilot( - None, - vec![ - "--drivers=solver1|http://localhost:11088/test_solver|10000000000000000,solver2|http://localhost:11088/solver2" - .to_string(), - "--price-estimation-drivers=solver1|http://localhost:11088/test_solver".to_string(), - "--max-winners-per-auction=2".to_string(), - ], - ).await; services .start_api(vec![ "--price-estimation-drivers=solver1|http://localhost:11088/test_solver".to_string(), @@ -409,6 +400,17 @@ async fn two_limit_orders_multiple_winners_test(web3: Web3) { ); let uid_b = services.create_order(&order_b).await.unwrap(); + // Start autopilot only once all the orders are created. + services.start_autopilot( + None, + vec![ + "--drivers=solver1|http://localhost:11088/test_solver|10000000000000000,solver2|http://localhost:11088/solver2" + .to_string(), + "--price-estimation-drivers=solver1|http://localhost:11088/test_solver".to_string(), + "--max-winners-per-auction=2".to_string(), + ], + ).await; + // Wait for trade let indexed_trades = || async { onchain.mint_block().await;