Skip to content

Visual Studio Code, rebuilt in Rust

Rust

test(windows): wait for the TLS server to exit before removing its cert

rokartur59a74aa6015a
diff --git a/native/crates/exthost/src/request.rs b/native/crates/exthost/src/request.rs
index 2e24fb723cc..7e6eaa626d4 100644
--- a/native/crates/exthost/src/request.rs
+++ b/native/crates/exthost/src/request.rs
@@ -272,6 +272,8 @@ mod tests {
}
let result = request(&Request::get(&format!("https://127.0.0.1:{port}/")));
server.kill().unwrap();
+ // Windows keeps cert.pem locked until the killed process exits (os error 32).
+ server.wait().unwrap();
std::fs::remove_dir_all(&dir).unwrap();
assert!(result.is_err(), "{:?}", result.map(|response| response.status));
}