Skip to content

The IDE you know, rebuilt in Rust. IntelliJ IDEA–style keymap, tool windows and search-everywhere in a fast native app: editor, code insight, debugger, Git, terminal, database and HTTP clients for 60+ languages.

test(sdk): only use a subst drive that shows the test's own directory

l0ng-ai0bc0396f80a8
diff --git a/crates/ide-sdk/src/discover.rs b/crates/ide-sdk/src/discover.rs
index c0de0540d..e18b2dae8 100644
--- a/crates/ide-sdk/src/discover.rs
+++ b/crates/ide-sdk/src/discover.rs
@@ -659,6 +659,10 @@ mod maven_path_tests {
impl Subst {
fn new(target: &Path) -> Self {
+ // Tests run in parallel and may race for the same free letter; only a drive that
+ // shows this target's marker is ours.
+ let marker = format!("{}.subst", target.file_name().unwrap().to_string_lossy());
+ std::fs::write(target.join(&marker), "").unwrap();
for letter in (b'D'..=b'Z').rev() {
let name = format!("{}:", char::from(letter));
let root = PathBuf::from(format!("{name}\\"));
@@ -666,7 +670,7 @@ mod maven_path_tests {
continue;
}
let output = Command::new("subst").arg(&name).arg(target).output().unwrap();
- if output.status.success() {
+ if output.status.success() && root.join(&marker).exists() {
return Self { name, root };
}
}