Skip to content

Commit 1d09332

Browse files
committed
Include amount of time it took to connect in test
1 parent 089bca0 commit 1d09332

File tree

2 files changed

+9
-3
lines changed

2 files changed

+9
-3
lines changed

test/test-manager/src/tests/helpers.rs

+7-2
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ use std::{
2929
collections::HashMap,
3030
net::{IpAddr, Ipv4Addr, SocketAddr},
3131
path::Path,
32-
time::Duration,
32+
time::{Duration, Instant},
3333
};
3434
use talpid_types::net::wireguard::{PeerConfig, PrivateKey, TunnelConfig};
3535
use test_rpc::{
@@ -432,6 +432,8 @@ pub async fn connect_and_wait(
432432
) -> Result<TunnelState, Error> {
433433
log::info!("Connecting");
434434

435+
let initial_time = Instant::now();
436+
435437
mullvad_client.connect_tunnel().await?;
436438
let new_state = wait_for_tunnel_state(mullvad_client.clone(), |state| {
437439
matches!(
@@ -445,7 +447,10 @@ pub async fn connect_and_wait(
445447
return Err(Error::UnexpectedErrorState(error_state));
446448
}
447449

448-
log::info!("Connected");
450+
log::info!(
451+
"Connected after {} seconds",
452+
initial_time.elapsed().as_secs()
453+
);
449454

450455
Ok(new_state)
451456
}

test/test-manager/src/tests/tunnel_state.rs

+2-1
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ use talpid_types::net::{Endpoint, TransportProtocol, TunnelEndpoint, TunnelType}
2222
use test_macro::test_function;
2323
use test_rpc::ServiceClient;
2424

25+
/// Set up nftables rules to drop packets larger than `max_packet_size` on the host.
2526
#[cfg(target_os = "linux")]
2627
async fn setup_nftables_drop_pings_rule(
2728
max_packet_size: u16,
@@ -33,7 +34,7 @@ async fn setup_nftables_drop_pings_rule(
3334
.unwrap();
3435

3536
log::debug!(
36-
"Set NF-tables ruleset to:\n{}",
37+
"Set nftables ruleset to:\n{}",
3738
String::from_utf8(output.stdout).unwrap()
3839
);
3940

0 commit comments

Comments
 (0)