style(client): cargo fmt
This commit is contained in:
@@ -291,7 +291,9 @@ mod tests {
|
||||
let target = url("https://api.example.com/v1/chat");
|
||||
let response = synthetic_response(StatusCode::TOO_MANY_REQUESTS, Some("3600"));
|
||||
mw.record_if_throttled(target.clone(), &response);
|
||||
let deadline = mw.deadline_for_test(&target).expect("clamped deadline kept");
|
||||
let deadline = mw
|
||||
.deadline_for_test(&target)
|
||||
.expect("clamped deadline kept");
|
||||
let upper = SystemTime::now() + Duration::from_secs(5);
|
||||
assert!(deadline <= upper, "custom ceiling must be honored");
|
||||
assert!(deadline > SystemTime::now());
|
||||
@@ -420,8 +422,9 @@ mod tests {
|
||||
let elapsed = SystemTime::now().duration_since(started).unwrap();
|
||||
let max_jitter = max_sleep_jitter(remaining);
|
||||
assert!(
|
||||
elapsed <= remaining.checked_sub(max_jitter).unwrap_or(remaining)
|
||||
+ Duration::from_millis(50),
|
||||
elapsed
|
||||
<= remaining.checked_sub(max_jitter).unwrap_or(remaining)
|
||||
+ Duration::from_millis(50),
|
||||
"wake must happen roughly a jitter-slice before the deadline, took {elapsed:?}"
|
||||
);
|
||||
assert!(max_jitter > Duration::ZERO, "jitter must be non-zero");
|
||||
@@ -438,4 +441,4 @@ mod tests {
|
||||
"jitter is capped at 2 s even for long waits"
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user