From b15b15fdd3fe7547f060a44d10b3881992d8cb18 Mon Sep 17 00:00:00 2001 From: Kristoffer Dalby Date: Sun, 18 Oct 2026 04:27:48 +0000 Subject: [PATCH] servertest: join replayed routers with their routes A route update sent after the join could be overtaken by the stream's first request and dropped; the probe joined with the routes set. --- hscontrol/servertest/via_ha_compat_test.go | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/hscontrol/servertest/via_ha_compat_test.go b/hscontrol/servertest/via_ha_compat_test.go index 133ed6469..9d44c6f48 100644 --- a/hscontrol/servertest/via_ha_compat_test.go +++ b/hscontrol/servertest/via_ha_compat_test.go @@ -603,11 +603,18 @@ func (r *stepReplay) apply(t *testing.T, step testcapture.Step) map[string]error r.api(t, step.Name, i, a) case "join": + // The probe joins with its routes, as `tailscale up + // --advertise-routes` does. An update sent after the join can + // be overtaken by the stream's first request, which has none. hi := &tailcfg.Hostinfo{ BackendLogID: "servertest-" + a.Node, Hostname: a.Hostname, RequestTags: requestTags(a, nil), } + if len(a.Routes) > 0 { + hi.RoutableIPs = prefixes(t, a.Routes) + } + r.hostinfo[a.Node] = hi opts := []servertest.ClientOption{servertest.WithUser(r.admin)} @@ -642,10 +649,6 @@ func (r *stepReplay) apply(t *testing.T, step testcapture.Step) map[string]error continue } - if len(a.Routes) > 0 { - r.announce(ctx, t, a.Node, a.Routes) - } - r.remember(a.Node) case "relogin":