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:
starr-openai
2026-05-07 04:30:05 -07:00
parent 7cd5127421
commit 926b8d77cd

View File

@@ -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!(