Skip to content

Commit a045788

Browse files
authored
Rollup merge of #99807 - Nilstrieb:wsl-ui-test-fix, r=Mark-Simulacrum
Fix PermissionDenied UI tests on WSL On my WSL with `appendWindowsPath=true`, running an invalid command returns `PermissionDenied` instead of `NotFound`, causing two UI tests to fail.
2 parents 48efd30 + 62ad16f commit a045788

File tree

2 files changed

+11
-6
lines changed

2 files changed

+11
-6
lines changed
+4-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,10 @@
11
// build-fail
22
// dont-check-compiler-stderr
33
// compile-flags: -C linker=llllll -C linker-flavor=ld
4-
// error-pattern: linker `llllll` not found
4+
// error-pattern: `llllll`
5+
6+
// Before, the error-pattern checked for "not found". On WSL with appendWindowsPath=true, running
7+
// in invalid command returns a PermissionDenied instead.
58

69
fn main() {
710
}

src/test/ui/process/process-spawn-nonexistent.rs

+7-5
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,11 @@ use std::io::ErrorKind;
66
use std::process::Command;
77

88
fn main() {
9-
assert_eq!(Command::new("nonexistent")
10-
.spawn()
11-
.unwrap_err()
12-
.kind(),
13-
ErrorKind::NotFound);
9+
let result = Command::new("nonexistent").spawn().unwrap_err().kind();
10+
11+
assert!(matches!(
12+
result,
13+
// Under WSL with appendWindowsPath=true, this fails with PermissionDenied
14+
ErrorKind::NotFound | ErrorKind::PermissionDenied
15+
));
1416
}

0 commit comments

Comments
 (0)