Skip to content

Commit

Permalink
fix threads issue
Browse files Browse the repository at this point in the history
  • Loading branch information
byteZorvin committed Sep 28, 2024
1 parent e150e0c commit 2a074d0
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 6 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/starknet-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -56,4 +56,4 @@ jobs:
- name: Run Starknet tests
run: |
cd orchestrator
cargo test -p starknet-settlement-client --nocapture
cargo test -p starknet-settlement-client -- --nocapture --test-threads=1
8 changes: 3 additions & 5 deletions crates/settlement-clients/starknet/src/tests/test.rs
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,9 @@ async fn wait_for_tx_success(
let mut attempt = 0;
loop {
attempt += 1;
if attempt >= 5 {
return false;
}
let reciept = match account.provider().get_transaction_status(transaction_hash).await {
Ok(reciept) => reciept,
Err(ProviderError::StarknetError(StarknetError::TransactionHashNotFound)) => {
Expand All @@ -74,11 +77,6 @@ async fn wait_for_tx_success(
TransactionExecutionStatus::Reverted => return false,
},
}

if attempt >= 5 {
return false;
}

// This is done, since currently madara does not increment nonce for pending transactions
tokio::time::sleep(duration).await;
}
Expand Down

0 comments on commit 2a074d0

Please sign in to comment.