Skip to content

Commit

Permalink
test-runtime: Add exponential backoff (#518)
Browse files Browse the repository at this point in the history
Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>
  • Loading branch information
lexnv committed Apr 27, 2022
1 parent 8afb2e5 commit 5605fbd
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions test-runtime/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ async fn run() {

// Download metadata from binary; retry until successful, or a limit is hit.
let metadata_bytes: sp_core::Bytes = {
const MAX_RETRIES: usize = 20;
const MAX_RETRIES: usize = 6;
let mut retries = 0;

loop {
Expand All @@ -85,7 +85,7 @@ async fn run() {
break res
}
_ => {
thread::sleep(time::Duration::from_secs(1));
thread::sleep(time::Duration::from_secs(1 << retries));
retries += 1;
}
};
Expand Down

0 comments on commit 5605fbd

Please sign in to comment.