From 10fbffbc697e3540968af3d60ce8dc4f1440d09b Mon Sep 17 00:00:00 2001 From: Han Xu Date: Tue, 10 Dec 2024 21:28:48 -0800 Subject: [PATCH] test: fix a flaky test --- tests/mdns_test.rs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/tests/mdns_test.rs b/tests/mdns_test.rs index f1c7edaa..2ef8e64e 100644 --- a/tests/mdns_test.rs +++ b/tests/mdns_test.rs @@ -1546,9 +1546,12 @@ fn test_name_conflict_resolution() { service_names.insert(info.get_fullname().to_string()); // Find and verify name conflict resolution. - if info.get_fullname().contains("(2)") { assert_eq!(info.get_hostname(), "conflict_host-2.local."); + } + + // Stop the wait if both are resolved. + if service_names.len() == 2 { break; } }