diff options
| author | Markus Pettersson <markus.pettersson@mullvad.net> | 2024-04-08 11:26:39 +0200 |
|---|---|---|
| committer | Markus Pettersson <markus.pettersson@mullvad.net> | 2024-04-08 11:26:39 +0200 |
| commit | 86d0ce199e591bef64edc964b6a7e4d1d0d21dd4 (patch) | |
| tree | dcb72fa4b4fe0640f66a5f6881e17610348c110b /test/test-runner/src | |
| parent | de28009a01832ef8f5910a93b6ae167a91cc90e0 (diff) | |
| parent | 291f115fefef468bdade0dc1db67482faf51adc4 (diff) | |
| download | mullvadvpn-86d0ce199e591bef64edc964b6a7e4d1d0d21dd4.tar.xz mullvadvpn-86d0ce199e591bef64edc964b6a7e4d1d0d21dd4.zip | |
Merge branch 'write-relay-selection-tests-for-relay-ip-overrides-des-579'
Diffstat (limited to 'test/test-runner/src')
| -rw-r--r-- | test/test-runner/src/main.rs | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/test/test-runner/src/main.rs b/test/test-runner/src/main.rs index d864968bbe..8399e118d3 100644 --- a/test/test-runner/src/main.rs +++ b/test/test-runner/src/main.rs @@ -6,7 +6,7 @@ use std::{ path::{Path, PathBuf}, process::Stdio, sync::Arc, - time::Duration, + time::{Duration, SystemTime}, }; use util::OnDrop; @@ -171,10 +171,18 @@ impl Service for TestServer { async fn geoip_lookup( self, - _: context::Context, + ctx: context::Context, mullvad_host: String, ) -> Result<test_rpc::AmIMullvad, test_rpc::Error> { - test_rpc::net::geoip_lookup(mullvad_host).await + let timeout = ctx + .deadline + .duration_since(SystemTime::now()) + .ok() + // account for some time to send the RPC response + .and_then(|d| d.checked_sub(Duration::from_millis(500))) + .unwrap_or_default(); + + test_rpc::net::geoip_lookup(mullvad_host, timeout).await } async fn resolve_hostname( |
