File tree Expand file tree Collapse file tree
src/tool/subcommands/api_cmd Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -187,7 +187,7 @@ mod tests {
187187 use anyhow:: Context as _;
188188 use directories:: ProjectDirs ;
189189 use std:: sync:: LazyLock ;
190- use std:: time:: Instant ;
190+ use std:: time:: { Duration , Instant } ;
191191 use tokio:: sync:: Mutex ;
192192 use url:: Url ;
193193
@@ -216,10 +216,23 @@ mod tests {
216216 . unwrap ( ) ;
217217 let project_dir = ProjectDirs :: from ( "com" , "ChainSafe" , "Forest" ) . unwrap ( ) ;
218218 let cache_dir = project_dir. cache_dir ( ) . join ( "test" ) . join ( "rpc-snapshots" ) ;
219- let path = download_file_with_cache ( & url, & cache_dir, DownloadFileOption :: NonResumable )
220- . await
221- . unwrap ( )
222- . path ;
219+ let path = crate :: utils:: retry (
220+ crate :: utils:: RetryArgs {
221+ timeout : Some ( Duration :: from_secs ( if crate :: utils:: is_ci ( ) {
222+ 20
223+ } else {
224+ 120
225+ } ) ) ,
226+ max_retries : Some ( 5 ) ,
227+ ..Default :: default ( )
228+ } ,
229+ || async {
230+ download_file_with_cache ( & url, & cache_dir, DownloadFileOption :: NonResumable ) . await
231+ } ,
232+ )
233+ . await
234+ . unwrap ( )
235+ . path ;
223236
224237 // We need to set RNG seed so that tests are run with deterministic
225238 // output. The snapshots should be generated with a node running with the same seed, if
You can’t perform that action at this time.
0 commit comments