tstest/integration: deflake TestC2NDebugNetmap, disable service collection

Fixes #17298

Change-Id: I83459fa1dad583c32395a80548510bc7ec035c41
Signed-off-by: Brad Fitzpatrick <bradfitz@tailscale.com>
This commit is contained in:
Brad Fitzpatrick 2025-09-26 12:29:36 -07:00 committed by Brad Fitzpatrick
parent 09a33b9262
commit e7a79ef5f1
2 changed files with 9 additions and 2 deletions

View File

@ -1784,7 +1784,9 @@ func TestPeerRelayPing(t *testing.T) {
func TestC2NDebugNetmap(t *testing.T) { func TestC2NDebugNetmap(t *testing.T) {
tstest.Shard(t) tstest.Shard(t)
tstest.Parallel(t) tstest.Parallel(t)
env := NewTestEnv(t) env := NewTestEnv(t, ConfigureControl(func(s *testcontrol.Server) {
s.CollectServices = "false"
}))
var testNodes []*TestNode var testNodes []*TestNode
var nodes []*tailcfg.Node var nodes []*tailcfg.Node

View File

@ -35,6 +35,7 @@ import (
"tailscale.com/tailcfg" "tailscale.com/tailcfg"
"tailscale.com/types/key" "tailscale.com/types/key"
"tailscale.com/types/logger" "tailscale.com/types/logger"
"tailscale.com/types/opt"
"tailscale.com/types/ptr" "tailscale.com/types/ptr"
"tailscale.com/util/httpm" "tailscale.com/util/httpm"
"tailscale.com/util/mak" "tailscale.com/util/mak"
@ -69,6 +70,10 @@ type Server struct {
// DefaultNodeCapabilities overrides the capability map sent to each client. // DefaultNodeCapabilities overrides the capability map sent to each client.
DefaultNodeCapabilities *tailcfg.NodeCapMap DefaultNodeCapabilities *tailcfg.NodeCapMap
// CollectServices, if non-empty, sets whether the control server asks
// for service updates. If empty, the default is "true".
CollectServices opt.Bool
// ExplicitBaseURL or HTTPTestServer must be set. // ExplicitBaseURL or HTTPTestServer must be set.
ExplicitBaseURL string // e.g. "http://127.0.0.1:1234" with no trailing URL ExplicitBaseURL string // e.g. "http://127.0.0.1:1234" with no trailing URL
HTTPTestServer *httptest.Server // if non-nil, used to get BaseURL HTTPTestServer *httptest.Server // if non-nil, used to get BaseURL
@ -1096,7 +1101,7 @@ func (s *Server) MapResponse(req *tailcfg.MapRequest) (res *tailcfg.MapResponse,
Node: node, Node: node,
DERPMap: s.DERPMap, DERPMap: s.DERPMap,
Domain: domain, Domain: domain,
CollectServices: "true", CollectServices: cmp.Or(s.CollectServices, "true"),
PacketFilter: packetFilterWithIngress(s.PeerRelayGrants), PacketFilter: packetFilterWithIngress(s.PeerRelayGrants),
DNSConfig: dns, DNSConfig: dns,
ControlTime: &t, ControlTime: &t,