From f6b4369fbaeff0ac90cbbbab97af3a3afcf1eb2e Mon Sep 17 00:00:00 2001 From: "B. Blechschmidt" Date: Tue, 21 Mar 2023 00:06:15 +0100 Subject: [PATCH] Run tests sequentially Since we share a tun device and routes, the tests do not support being executed in parallel. --- Cargo.toml | 5 +++-- tests/proxy.rs | 3 +++ 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index 9088bcb..3b70be0 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -13,7 +13,8 @@ smoltcp = { version = "0.9", features = ["std"] } [dev-dependencies] ctor = "0.1" -reqwest = { version = "0.11", features = ["blocking", "json"] } fork = "0.1" +nix = { version = "0.26", features = ["process", "signal"] } prctl = "1.0" -nix = { version = "0.26", features = ["process", "signal"] } \ No newline at end of file +reqwest = { version = "0.11", features = ["blocking", "json"] } +serial_test = "1.0" diff --git a/tests/proxy.rs b/tests/proxy.rs index 844ade0..0fd4d32 100644 --- a/tests/proxy.rs +++ b/tests/proxy.rs @@ -5,6 +5,7 @@ mod tests { use fork::Fork; use nix::sys::signal; use nix::unistd::Pid; + use serial_test::serial; use std::env; use std::io::BufRead; use std::net::{SocketAddr, ToSocketAddrs}; @@ -147,11 +148,13 @@ mod tests { } #[test] + #[serial] fn test_socks5() { run_test(|test| test.proxy_type == ProxyType::Socks5) } #[test] + #[serial] fn test_http() { run_test(|test| test.proxy_type == ProxyType::Http) }