diff --git a/src/tools/remote-test-client/src/main.rs b/src/tools/remote-test-client/src/main.rs index dd2c09c430b61..43980bdfd0913 100644 --- a/src/tools/remote-test-client/src/main.rs +++ b/src/tools/remote-test-client/src/main.rs @@ -18,6 +18,9 @@ use std::time::Duration; const REMOTE_ADDR_ENV: &str = "TEST_DEVICE_ADDR"; const DEFAULT_ADDR: &str = "127.0.0.1:12345"; +const TCP_TIMEOUT_ENV: &str = "TCP_TIMEOUT"; +const DEFAULT_TCP_TIMEOUT: u64 = 100; + macro_rules! t { ($e:expr) => { match $e { @@ -69,16 +72,26 @@ fn spawn_emulator(target: &str, server: &Path, tmpdir: &Path, rootfs: Option break, + Err(e) if e.kind() == io::ErrorKind::WouldBlock => panic!( + "TCP timeout of {timeout}ms exceeded, set `{TCP_TIMEOUT_ENV}` to a larger value" + ), + Err(_) => (), } } }