From 63cc169d1e300aa3552a6f7a4ce216169d20cdcf Mon Sep 17 00:00:00 2001 From: Smitty Date: Sun, 27 Jun 2021 09:53:27 -0400 Subject: [PATCH] Don't run a publically reachable server in tests This causes Windows Defender's firewall to pop up during tests to ask if I want to allow the test program to access the public Internet, since it was listening on `0.0.0.0`. The test server doesn't actually need to be publically reachable, so this makes it so it is only reachable locally, which makes Windows Defender happy. --- .../ui/process-termination/process-termination-blocking-io.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/test/ui/process-termination/process-termination-blocking-io.rs b/src/test/ui/process-termination/process-termination-blocking-io.rs index f306a61a5387..b2dab5c93814 100644 --- a/src/test/ui/process-termination/process-termination-blocking-io.rs +++ b/src/test/ui/process-termination/process-termination-blocking-io.rs @@ -9,7 +9,7 @@ use std::{net::TcpListener, sync::mpsc, thread}; fn main() { let (tx, rx) = mpsc::channel(); thread::spawn(move || { - let listen = TcpListener::bind("0.0.0.0:0").unwrap(); + let listen = TcpListener::bind("127.0.0.1:0").unwrap(); tx.send(()).unwrap(); while let Ok(_) = listen.accept() {} });