test(server): avoid float equality in usage scenario

Use a tolerance-based runtime assertion so workspace clippy can run with float_cmp denied.
This commit is contained in:
Bryan Helmkamp 2026-05-04 10:57:28 -04:00
parent f3f0fa0e80
commit 36c686b828
No known key found for this signature in database

View file

@ -150,5 +150,8 @@ fn assert_non_llm_billing(billing: &serde_json::Value, expected_stage_ids: &[&st
let total_runtime_secs = billing["totals"]["runtime_secs"]
.as_f64()
.expect("totals should include runtime_secs");
assert_eq!(total_runtime_secs, runtime_secs);
assert!(
(total_runtime_secs - runtime_secs).abs() < f64::EPSILON,
"total runtime {total_runtime_secs} should equal summed stage runtime {runtime_secs}"
);
}