From 7294a69dfd49d55037473c72c7983df0eae89b1d Mon Sep 17 00:00:00 2001 From: Brad Fitzpatrick Date: Sun, 22 Nov 2026 00:09:45 +0000 Subject: [PATCH] tsnet: fail the test instead of panicking when a ping times out in test helpers setupTwoClientTest and TestDialThroughExitNode used must.Get(lc.Ping(...)) to wait for the TSMP path to come up. When that ping timed out, must.Get panicked, killing the whole tsnet test binary. The flakes dashboard then blamed every test that was running or paused at the time (TestPacketFilterFromNetmap, TestListenService, TestListen*, TestDialUDP, ...), not just the one whose ping failed. Use t.Fatalf instead so a failed ping fails only its own test. The underlying ping failure was the wireguard-go duplicate handshake initiation race, fixed by the wireguard-go bump in #22537. Updates #22551 Change-Id: I227852aaa576e500df036bb1700fe6c7589b0a25 Signed-off-by: Brad Fitzpatrick --- tsnet/tsnet_test.go | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/tsnet/tsnet_test.go b/tsnet/tsnet_test.go index 31a1be7e6..c6cfc7eb6 100644 --- a/tsnet/tsnet_test.go +++ b/tsnet/tsnet_test.go @@ -615,7 +615,9 @@ func TestDialThroughExitNode(t *testing.T) { // Ping to make sure the connection is up. pingCtx, cancelPing := pingTimeout(ctx) defer cancelPing() - must.Get(lc2.Ping(pingCtx, s1ip, tailcfg.PingTSMP)) + if _, err := lc2.Ping(pingCtx, s1ip, tailcfg.PingTSMP); err != nil { + t.Fatalf("TSMP ping s2 -> s1: %v", err) + } must.Get(lc2.EditPrefs(ctx, &ipn.MaskedPrefs{ Prefs: ipn.Prefs{ @@ -2923,7 +2925,9 @@ func setupTwoClientTest(t *testing.T, useTUN bool) *listenTest { pingCtx, cancelPing := pingTimeout(ctx) defer cancelPing() - must.Get(lc1.Ping(pingCtx, s2ip4, tailcfg.PingTSMP)) + if _, err := lc1.Ping(pingCtx, s2ip4, tailcfg.PingTSMP); err != nil { + t.Fatalf("TSMP ping s1 -> s2: %v", err) + } return &listenTest{ control: control,