wgengine/magicsock,tstest/natlab/vmtest: only send callMeMaybe with endpoints (#20088)

9be21088f4 changed sending disco pings so
a callMeMaybe would be not be gated by endpoints existing if the node
was running off of a cached netmap.

This commit partly reverts that change, but keeps in a few bug fixes in
that commit and the tests that was introduced and now skipped.

The behaviour prior to 9be21088f4 is
retained.

Updates #20085

Signed-off-by: Claus Lensbøl <claus@tailscale.com>
This commit is contained in:
Claus Lensbøl
2026-06-10 16:19:51 -04:00
committed by GitHub
parent e4ea65d32d
commit 2690d58e47
2 changed files with 15 additions and 8 deletions
+14
View File
@@ -14,6 +14,7 @@ import (
"time"
"tailscale.com/client/local"
"tailscale.com/cmd/testwrapper/flakytest"
"tailscale.com/ipn"
"tailscale.com/net/udprelay/status"
"tailscale.com/tailcfg"
@@ -1156,9 +1157,17 @@ func TestCachedNetmapAfterRestart(t *testing.T) {
//
// The test has two modes, pinging from the offline node to the online node,
// and pinging from the online node to the offline node.
//
// TODO(cmol): The online -> offline test is flakey for now. The TSMP disco
// key exchange currently relies on disco ping messages being sent. These will
// however not be sent if there is not endpoints on the online node which is
// possible in the event where a node has registered but not finished STUN.
func TestDirectConnectionWithCachedNetmapOnOneNode(t *testing.T) {
for _, testPingFrom := range []string{"offline", "online"} {
t.Run(fmt.Sprintf("ping_from_%s", testPingFrom), func(t *testing.T) {
if testPingFrom == "online" {
flakytest.Mark(t, "https://github.com/tailscale/tailscale/issues/19843")
}
env := vmtest.New(t)
aNet := env.AddNetwork("1.0.0.1", "192.168.1.1/24", vnet.EasyNAT)
@@ -1243,7 +1252,12 @@ func TestDirectConnectionWithCachedNetmapOnOneNode(t *testing.T) {
// WireGuard tunnel after both restarted while the control server is
// unreachable. After restart one node must use only its on-disk cached
// netmaps to re-connect and ping the other node.
// TODO(cmol): The test is flakey for now. The TSMP disco key exchange
// currently relies on disco ping messages being sent. These will however not
// be sent if there is not endpoints on the online node which is possible in
// the event where a node has registered but not finished STUN.
func TestDirectConnectionWithCachedNetmapOnTwoNodes(t *testing.T) {
flakytest.Mark(t, "https://github.com/tailscale/tailscale/issues/19843")
env := vmtest.New(t)
aNet := env.AddNetwork("1.0.0.1", "192.168.1.1/24", vnet.EasyNAT)