mirror of
https://github.com/openai/codex.git
synced 2026-10-20 17:38:45 +00:00
Stabilize Rosetta test timing and retry delay telemetry (#47832)
## Why Cold Rosetta translation and cache invalidation from hard-linked executables can interfere with timed CLI tests. Sampling the clock twice also makes local retry telemetry report a delay shorter than the selected backoff. ## What changed - Warm CLI fixtures with `--version` on macOS x86_64 before timed checks, and use copies or Unix symlinks to avoid invalidating the shared executable's Rosetta cache. - Use one clock sample to calculate the response retry deadline and recorded delay. - Include the retry telemetry event in delay-range assertion failures for the headerless rate-limit stream test. GitOrigin-RevId: fc573bfff912e999cf74b94a1c6e7ae1be07974b
This commit is contained in:
@@ -132,10 +132,10 @@ pub(crate) async fn handle_response_stream_error(
|
||||
)
|
||||
.await;
|
||||
}
|
||||
let retry_at = retry_after
|
||||
.map(RetryAfter::deadline)
|
||||
.unwrap_or_else(|| Instant::now() + delay);
|
||||
let delay = retry_at.saturating_duration_since(Instant::now());
|
||||
// Use one clock sample so local backoff telemetry retains the selected delay.
|
||||
let now = Instant::now();
|
||||
let retry_at = retry_after.map(RetryAfter::deadline).unwrap_or(now + delay);
|
||||
let delay = retry_at.saturating_duration_since(now);
|
||||
codex_client::record_retry!(retry_count, delay, operation);
|
||||
tokio::time::sleep_until(retry_at).await;
|
||||
return Ok(());
|
||||
|
||||
Reference in New Issue
Block a user