mirror of
https://github.com/tailscale/tailscale.git
synced 2025-09-21 05:31:36 +02:00
ipn/ipnlocal: fix racy tests (round 2)
Change-Id: Idef2a891b37f9dc76e86eb425cc0fc8abec31a45
This commit is contained in:
parent
b846167f0d
commit
8c89e75c50
@ -2367,19 +2367,20 @@ func TestObserveDNSResponse(t *testing.T) {
|
||||
}
|
||||
|
||||
rc := &appctest.RouteCollector{}
|
||||
b.appConnector = appc.NewAppConnector(appc.Config{
|
||||
a := appc.NewAppConnector(appc.Config{
|
||||
Logf: t.Logf,
|
||||
EventBus: bus,
|
||||
RouteAdvertiser: rc,
|
||||
HasStoredRoutes: shouldStore,
|
||||
})
|
||||
b.appConnector.UpdateDomains([]string{"example.com"})
|
||||
b.appConnector.Wait(context.Background())
|
||||
a.UpdateDomains([]string{"example.com"})
|
||||
a.Wait(t.Context())
|
||||
b.appConnector = a
|
||||
|
||||
if err := b.ObserveDNSResponse(dnsResponse("example.com.", "192.0.0.8")); err != nil {
|
||||
t.Errorf("ObserveDNSResponse: %v", err)
|
||||
}
|
||||
b.appConnector.Wait(context.Background())
|
||||
a.Wait(t.Context())
|
||||
wantRoutes := []netip.Prefix{netip.MustParsePrefix("192.0.0.8/32")}
|
||||
if !slices.Equal(rc.Routes(), wantRoutes) {
|
||||
t.Fatalf("got routes %v, want %v", rc.Routes(), wantRoutes)
|
||||
|
Loading…
x
Reference in New Issue
Block a user