Skip to content

Commit 2edbd05

Browse files
committed
make test more reliable
1 parent 525224a commit 2edbd05

File tree

1 file changed

+14
-4
lines changed

1 file changed

+14
-4
lines changed

crates/e2e/tests/e2e/wrapper.rs

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -323,10 +323,20 @@ async fn forked_mainnet_wrapper_test(web3: Web3) {
323323
tracing::info!("Wrapper call data: {:?}", call_data_strings);
324324

325325
// Check that the auction ID propogated through the wrappers ok
326-
services
327-
.get_solver_competition(solve_tx_hash)
328-
.await
329-
.unwrap();
326+
// Sometimes the API isnt ready to respond to the request immediately so we wait
327+
// a bit for success
328+
wait_for_condition(TIMEOUT, || async {
329+
let auction_info = services.get_solver_competition(solve_tx_hash).await;
330+
331+
if let Ok(a) = auction_info {
332+
tracing::info!("Pulled auction id {:?}", a.auction_id);
333+
true
334+
} else {
335+
false
336+
}
337+
})
338+
.await
339+
.unwrap();
330340

331341
tracing::info!(
332342
"Order with wrapper successfully traded on forked mainnet with verified wrapper calls"

0 commit comments

Comments
 (0)