mirror of
https://github.com/openai/codex.git
synced 2026-05-29 23:40:29 +00:00
fix: tolerate Windows delete-pending memory files in tests
Co-authored-by: Codex noreply@openai.com
This commit is contained in:
@@ -365,8 +365,13 @@ async fn wait_for_single_request(mock: &ResponseMock) -> ResponsesRequest {
|
||||
async fn wait_for_file_removed(path: &Path) -> anyhow::Result<()> {
|
||||
let deadline = Instant::now() + Duration::from_secs(10);
|
||||
loop {
|
||||
if !tokio::fs::try_exists(path).await? {
|
||||
return Ok(());
|
||||
match tokio::fs::try_exists(path).await {
|
||||
Ok(false) => return Ok(()),
|
||||
Ok(true) => {}
|
||||
Err(err)
|
||||
if cfg!(target_os = "windows")
|
||||
&& err.kind() == std::io::ErrorKind::PermissionDenied => {}
|
||||
Err(err) => return Err(err.into()),
|
||||
}
|
||||
assert!(
|
||||
Instant::now() < deadline,
|
||||
|
||||
Reference in New Issue
Block a user