Skip to content

Commit 9e1f531

Browse files
committed
Fix test run-pass-fulldeps\issue-15149.rs on Windows
1 parent b301e02 commit 9e1f531

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

src/test/run-pass-fulldeps/issue-15149.rs

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,10 @@ fn test() {
6464
str::from_utf8(&child_output.stdout).unwrap(),
6565
str::from_utf8(&child_output.stderr).unwrap()));
6666

67-
fs::remove_dir_all(&child_dir).unwrap();
68-
67+
let res = fs::remove_dir_all(&child_dir);
68+
if res.is_err() {
69+
// On Windows deleting just executed mytest.exe can fail because it's still locked
70+
std::thread::sleep_ms(1000);
71+
fs::remove_dir_all(&child_dir).unwrap();
72+
}
6973
}

0 commit comments

Comments
 (0)