mirror of
https://github.com/openai/codex.git
synced 2026-06-01 19:02:59 +00:00
Tolerate transient Windows metadata denial in memory startup test
Keep polling when Windows temporarily denies metadata reads while the phase 2 memory workspace is being cleaned up, so the test still verifies the file is removed and the baseline becomes clean. Co-authored-by: Codex <noreply@openai.com>
This commit is contained in:
@@ -372,7 +372,16 @@ 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? {
|
||||
let exists = match tokio::fs::try_exists(path).await {
|
||||
Ok(exists) => exists,
|
||||
Err(err) if err.kind() == std::io::ErrorKind::PermissionDenied => {
|
||||
// Windows can transiently deny metadata reads while another task
|
||||
// is removing or resetting files in this workspace.
|
||||
true
|
||||
}
|
||||
Err(err) => return Err(err.into()),
|
||||
};
|
||||
if !exists {
|
||||
return Ok(());
|
||||
}
|
||||
assert!(
|
||||
|
||||
Reference in New Issue
Block a user