mirror of
https://github.com/strukturag/nextcloud-spreed-signaling
synced 2024-05-15 20:16:34 +02:00
Fix flaky "TestProxyConfigStaticDNS".
Problem was caused by the initial wakeup check sometimes running, clearing the expected events too soon.
This commit is contained in:
parent
da00080303
commit
9010e91ff4
|
@ -78,19 +78,21 @@ func TestProxyConfigStaticSimple(t *testing.T) {
|
||||||
|
|
||||||
func TestProxyConfigStaticDNS(t *testing.T) {
|
func TestProxyConfigStaticDNS(t *testing.T) {
|
||||||
lookup := newMockDnsLookupForTest(t)
|
lookup := newMockDnsLookupForTest(t)
|
||||||
lookup.Set("foo", []net.IP{
|
|
||||||
net.ParseIP("192.168.0.1"),
|
|
||||||
net.ParseIP("10.1.2.3"),
|
|
||||||
})
|
|
||||||
|
|
||||||
proxy := newMcuProxyForConfig(t)
|
proxy := newMcuProxyForConfig(t)
|
||||||
config, dnsMonitor := newProxyConfigStatic(t, proxy, true, "https://foo/")
|
config, dnsMonitor := newProxyConfigStatic(t, proxy, true, "https://foo/")
|
||||||
proxy.Expect("add", "https://foo/", lookup.Get("foo")...)
|
|
||||||
if err := config.Start(); err != nil {
|
if err := config.Start(); err != nil {
|
||||||
t.Fatal(err)
|
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()
|
dnsMonitor.checkHostnames()
|
||||||
|
|
||||||
lookup.Set("foo", []net.IP{
|
lookup.Set("foo", []net.IP{
|
||||||
net.ParseIP("192.168.0.1"),
|
net.ParseIP("192.168.0.1"),
|
||||||
net.ParseIP("192.168.1.1"),
|
net.ParseIP("192.168.1.1"),
|
||||||
|
|
Loading…
Reference in a new issue