From 9e1f531d536e5fb1a1978959acef079a2c56e748 Mon Sep 17 00:00:00 2001 From: petrochenkov Date: Tue, 19 May 2015 20:37:17 +0300 Subject: [PATCH] Fix test run-pass-fulldeps\issue-15149.rs on Windows --- src/test/run-pass-fulldeps/issue-15149.rs | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/test/run-pass-fulldeps/issue-15149.rs b/src/test/run-pass-fulldeps/issue-15149.rs index ea7e959a73c..8bc03d148c6 100644 --- a/src/test/run-pass-fulldeps/issue-15149.rs +++ b/src/test/run-pass-fulldeps/issue-15149.rs @@ -64,6 +64,10 @@ fn test() { str::from_utf8(&child_output.stdout).unwrap(), str::from_utf8(&child_output.stderr).unwrap())); - fs::remove_dir_all(&child_dir).unwrap(); - + let res = fs::remove_dir_all(&child_dir); + if res.is_err() { + // On Windows deleting just executed mytest.exe can fail because it's still locked + std::thread::sleep_ms(1000); + fs::remove_dir_all(&child_dir).unwrap(); + } }