Skip to content

Commit

Permalink
Fix flaky test (#198)
Browse files Browse the repository at this point in the history
* tests: add dependencies for capturing log output
* tests: rename clashing service name between two tests
  • Loading branch information
oysteintveit-nordicsemi committed Apr 18, 2024
1 parent c76600e commit 020df6e
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
3 changes: 3 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -24,4 +24,7 @@ polling = "2.1" # select/poll sockets
socket2 = { version = "0.5.5", features = ["all"] } # socket APIs

[dev-dependencies]
env_logger = { version = "= 0.10.2", default-features = false, features= ["humantime"] }
fastrand = "1.8"
test-log = "= 0.2.14"
test-log-macros = "= 0.2.14"
3 changes: 2 additions & 1 deletion tests/mdns_test.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ use std::net::{IpAddr, Ipv4Addr, Ipv6Addr};
use std::sync::{Arc, Mutex};
use std::thread::sleep;
use std::time::{Duration, SystemTime};
use test_log::test;

/// This test covers:
/// register(announce), browse(query), response, unregister, shutdown.
Expand Down Expand Up @@ -1065,7 +1066,7 @@ fn test_hostname_resolution() {
.unwrap();

let my_service = ServiceInfo::new(
"_test._tcp.local.",
"_host_res_test._tcp.local.",
"my_instance",
hostname,
&[service_ip_addr] as &[IpAddr],
Expand Down

0 comments on commit 020df6e

Please sign in to comment.