Skip to content

Commit fca4020

Browse files
committed
Enable remove-dir-all-race test on Windows
1 parent bb9d5c4 commit fca4020

File tree

1 file changed

+6
-12
lines changed
  • tests/run-make/remove-dir-all-race

1 file changed

+6
-12
lines changed

tests/run-make/remove-dir-all-race/rmake.rs

+6-12
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,11 @@
1-
//@ ignore-windows
2-
31
// This test attempts to make sure that running `remove_dir_all`
42
// doesn't result in a NotFound error one of the files it
53
// is deleting is deleted concurrently.
6-
//
7-
// The windows implementation for `remove_dir_all` is significantly
8-
// more complicated, and has not yet been brought up to par with
9-
// the implementation on other platforms, so this test is marked as
10-
// `ignore-windows` until someone more expirenced with windows can
11-
// sort that out.
124

135
use std::fs::remove_dir_all;
146
use std::path::Path;
15-
use std::thread;
167
use std::time::Duration;
8+
use std::{io, thread};
179

1810
use run_make_support::rfs::{create_dir, write};
1911
use run_make_support::run_in_tmpdir;
@@ -36,8 +28,10 @@ fn main() {
3628
let t2 = scope.spawn(|| {
3729
let r1 = remove_dir_all("outer/inner");
3830
let r2 = remove_dir_all("outer/inner.txt");
39-
if r1.is_ok() && r2.is_err() {
40-
race_happened = true;
31+
if let Err(e) = r2 {
32+
if r1.is_ok() && e.kind() == io::ErrorKind::NotFound {
33+
race_happened = true;
34+
}
4135
}
4236
});
4337
});
@@ -49,7 +43,7 @@ fn main() {
4943
let Err(err) = remove_dir_all("outer") else {
5044
panic!("removing nonexistant dir did not result in an error");
5145
};
52-
assert_eq!(err.kind(), std::io::ErrorKind::NotFound);
46+
assert_eq!(err.kind(), io::ErrorKind::NotFound);
5347
}
5448
});
5549
if !race_happened {

0 commit comments

Comments
 (0)