File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -13,9 +13,9 @@ url = "2"
1313serde_json = " 1.0.104"
1414nuid = " 0.5"
1515rand = " 0.10.1"
16- tokio-retry = " 0.3.0"
1716
1817[dev-dependencies ]
1918async-nats = { path = " ../async-nats" }
2019tokio = { version = " 1" , features = [" full" ] }
20+ tryhard = " 0.5"
2121futures-util = " 0.3"
Original file line number Diff line number Diff line change @@ -366,14 +366,15 @@ mod tests {
366366
367367 let jetstream = async_nats:: jetstream:: new ( client) ;
368368
369- let retry_strategy = tokio_retry:: strategy:: ExponentialBackoff :: from_millis ( 500 ) . take ( 3 ) ;
370- let mut stream = tokio_retry:: Retry :: start ( retry_strategy, || {
369+ let mut stream = tryhard:: retry_fn ( || {
371370 jetstream. create_stream ( async_nats:: jetstream:: stream:: Config {
372371 name : "replicated" . to_string ( ) ,
373372 num_replicas : 3 ,
374373 ..Default :: default ( )
375374 } )
376375 } )
376+ . retries ( 3 )
377+ . exponential_backoff ( std:: time:: Duration :: from_millis ( 500 ) )
377378 . await
378379 . unwrap ( ) ;
379380 assert_eq ! ( stream. info( ) . await . unwrap( ) . config. num_replicas, 3 ) ;
You can’t perform that action at this time.
0 commit comments