Exponential backoff retry logic
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

fix(lint): use Fmt instead of Printf/Format in tests

Replace Printf.sprintf with Fmt.str and Printf.printf with Fmt.pr
across requests, retry, and rpmsg test files.

+5 -5
+5 -5
test/test.ml
··· 36 36 Retry.config ~max_retries:5 ~backoff_factor:0.5 ~backoff_max:30.0 37 37 ~jitter:true () 38 38 in 39 - let output = Format.asprintf "%a" Retry.pp_config config in 39 + let output = Fmt.str "%a" Retry.pp_config config in 40 40 (* Check exact substrings using a ref flag *) 41 41 let found_max_retries = ref false in 42 42 let found_backoff_factor = ref false in ··· 88 88 (fun (attempt, expected) -> 89 89 let delay = Retry.calculate_backoff ~config ~attempt in 90 90 Alcotest.(check (float 0.001)) 91 - (Printf.sprintf "attempt %d" attempt) 91 + (Fmt.str "attempt %d" attempt) 92 92 expected delay) 93 93 backoff_test_vectors_no_cap 94 94 ··· 128 128 (fun (attempt, expected) -> 129 129 let delay = Retry.calculate_backoff ~config ~attempt in 130 130 Alcotest.(check (float 0.01)) 131 - (Printf.sprintf "attempt %d" attempt) 131 + (Fmt.str "attempt %d" attempt) 132 132 expected delay) 133 133 backoff_test_vectors_default_config 134 134 ··· 163 163 (fun (attempt, expected) -> 164 164 let delay = Retry.calculate_backoff ~config ~attempt in 165 165 Alcotest.(check (float 0.01)) 166 - (Printf.sprintf "AWS-style attempt %d" attempt) 166 + (Fmt.str "AWS-style attempt %d" attempt) 167 167 expected delay) 168 168 backoff_test_vectors_aws_style 169 169 ··· 189 189 (fun (attempt, expected) -> 190 190 let delay = Retry.calculate_backoff ~config ~attempt in 191 191 Alcotest.(check (float 0.01)) 192 - (Printf.sprintf "GCP-style attempt %d" attempt) 192 + (Fmt.str "GCP-style attempt %d" attempt) 193 193 expected delay) 194 194 backoff_test_vectors_gcp_style 195 195