Skip to content

Commit

Permalink
Merge pull request #671 from strukturag/fix-flaky-static-proxy-dns
Browse files Browse the repository at this point in the history
Fix flaky "TestProxyConfigStaticDNS".
  • Loading branch information
fancycode authored Feb 27, 2024
2 parents da00080 + 9010e91 commit 26a65ce
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions proxy_config_static_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -78,19 +78,21 @@ func TestProxyConfigStaticSimple(t *testing.T) {

func TestProxyConfigStaticDNS(t *testing.T) {
lookup := newMockDnsLookupForTest(t)
lookup.Set("foo", []net.IP{
net.ParseIP("192.168.0.1"),
net.ParseIP("10.1.2.3"),
})

proxy := newMcuProxyForConfig(t)
config, dnsMonitor := newProxyConfigStatic(t, proxy, true, "https://foo/")
proxy.Expect("add", "https://foo/", lookup.Get("foo")...)
if err := config.Start(); err != nil {
t.Fatal(err)
}

time.Sleep(time.Millisecond)

lookup.Set("foo", []net.IP{
net.ParseIP("192.168.0.1"),
net.ParseIP("10.1.2.3"),
})
proxy.Expect("add", "https://foo/", lookup.Get("foo")...)
dnsMonitor.checkHostnames()

lookup.Set("foo", []net.IP{
net.ParseIP("192.168.0.1"),
net.ParseIP("192.168.1.1"),
Expand Down

0 comments on commit 26a65ce

Please sign in to comment.