Skip to content

Commit

Permalink
More github test troubleshooting
Browse files Browse the repository at this point in the history
  • Loading branch information
jdomnitz committed Nov 23, 2024
1 parent 49fa042 commit 5f4755a
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions test/ServiceDiscoveryTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,8 @@ public void Advertises_SharedService()
[TestMethod]
public void Probe_Service()
{
var service = new ServiceProfile("z", "_sdtest-11._udp", 1024, new[] { IPAddress.Loopback });
MulticastService.IncludeLoopbackInterfaces = true;
var service = new ServiceProfile("z", "_sdtest-111._udp", 1024, new[] { IPAddress.Loopback });
var done = new ManualResetEvent(false);

var mdns = new MulticastService();
Expand All @@ -116,14 +117,15 @@ public void Probe_Service()
finally
{
mdns.Stop();
MulticastService.IncludeLoopbackInterfaces = false;
}
}
}

[TestMethod]
public void Probe_Service2()
public void Probe_Conflict()
{
var service = new ServiceProfile("z", "_sdtest-11._udp", 1024, new[] { IPAddress.Loopback });
var service = new ServiceProfile("z", "_sdtest-112._udp", 1024, new[] { IPAddress.Loopback });

var sd = new ServiceDiscovery();
sd.Advertise(service);
Expand All @@ -150,9 +152,9 @@ public void Probe_Service2()
}

[TestMethod]
public void Probe_Service3()
public void Probe_NoConflict()
{
var service = new ServiceProfile("z", "_sdtest-11._udp", 1024, new[] { IPAddress.Loopback });
var service = new ServiceProfile("z", "_sdtest-113._udp", 1024, new[] { IPAddress.Loopback });

var mdns = new MulticastService();
using var sd = new ServiceDiscovery(mdns);
Expand Down Expand Up @@ -296,12 +298,12 @@ public void Discover_AllServices()
[TestMethod]
public void Discover_AllServices_Unicast()
{
MulticastService.IncludeLoopbackInterfaces = true;
var service = new ServiceProfile("x", "_sdtest-5._udp", 1024);
var done = new ManualResetEvent(false);
var mdns = new MulticastService();
var sd = new ServiceDiscovery(mdns);

MulticastService.IncludeLoopbackInterfaces = true;
mdns.NetworkInterfaceDiscovered += (s, e) => sd.QueryUnicastAllServices();
sd.ServiceDiscovered += (s, serviceName) =>
{
Expand Down

0 comments on commit 5f4755a

Please sign in to comment.