tstest/integration/testcontrol: fix data race

Noticed in earlier GitHub actions failure.

Fixes #11994

Change-Id: Iba8d753caaa3dacbe2da9171d96c5f99b12e62d7
Signed-off-by: Brad Fitzpatrick <bradfitz@tailscale.com>
clairew/revert-storing-last-suggested
Brad Fitzpatrick 7 months ago committed by Brad Fitzpatrick
parent e9505e5432
commit b62cfc430a

@ -13,6 +13,7 @@ import (
"fmt"
"io"
"log"
"maps"
"math/rand"
"net/http"
"net/http/httptest"
@ -914,7 +915,12 @@ func (s *Server) MapResponse(req *tailcfg.MapRequest) (res *tailcfg.MapResponse,
// node key rotated away (once test server supports that)
return nil, nil
}
node.CapMap = s.nodeCapMaps[nk]
s.mu.Lock()
nodeCapMap := maps.Clone(s.nodeCapMaps[nk])
s.mu.Unlock()
node.CapMap = nodeCapMap
node.Capabilities = append(node.Capabilities, tailcfg.NodeAttrDisableUPnP)
user, _ := s.getUser(nk)

Loading…
Cancel
Save