diff --git a/clash_lib/build.rs b/clash_lib/build.rs index 3194ade1d..aa8dfbf64 100644 --- a/clash_lib/build.rs +++ b/clash_lib/build.rs @@ -1,5 +1,5 @@ -fn main(){ +fn main() { if std::env::var("CLASH_RS_CI").is_ok() { println!("cargo:rustc-cfg=ci"); } -} \ No newline at end of file +} diff --git a/clash_lib/src/proxy/utils/test_utils/docker_runner.rs b/clash_lib/src/proxy/utils/test_utils/docker_runner.rs index e24920301..0f78316a3 100644 --- a/clash_lib/src/proxy/utils/test_utils/docker_runner.rs +++ b/clash_lib/src/proxy/utils/test_utils/docker_runner.rs @@ -1,5 +1,3 @@ -//! This example will run a non-interactive command inside the container using `docker exec` - use std::collections::HashMap; use bollard::container::{Config, RemoveContainerOptions}; @@ -11,6 +9,8 @@ use bollard::image::CreateImageOptions; use anyhow::Result; use futures::{Future, TryStreamExt}; +const TIMEOUT_DURATION: u64 = 3; + pub struct DockerTestRunner { instance: Docker, id: String, @@ -51,7 +51,7 @@ impl DockerTestRunner { res = fut => { res }, - _ = tokio::time::sleep(std::time::Duration::from_secs(3))=> { + _ = tokio::time::sleep(std::time::Duration::from_secs(TIMEOUT_DURATION))=> { tracing::warn!("timeout"); Ok(()) }