@@ -235,6 +235,7 @@ func startServer(t *testing.T, ctx context.Context, controlURL, hostname string)
235235}
236236
237237func TestDialBlocks (t * testing.T ) {
238+ tstest .Shard (t )
238239 tstest .ResourceCheck (t )
239240 ctx , cancel := context .WithTimeout (context .Background (), 30 * time .Second )
240241 defer cancel ()
@@ -282,6 +283,7 @@ func TestDialBlocks(t *testing.T) {
282283// - s2 can dial through the subnet router functionality (getting a synthetic RST
283284// that we verify we generated & saw)
284285func TestConn (t * testing.T ) {
286+ tstest .Shard (t )
285287 tstest .ResourceCheck (t )
286288 ctx , cancel := context .WithTimeout (context .Background (), 30 * time .Second )
287289 defer cancel ()
@@ -414,6 +416,7 @@ func TestConn(t *testing.T) {
414416
415417func TestLoopbackLocalAPI (t * testing.T ) {
416418 flakytest .Mark (t , "https://github.com/tailscale/tailscale/issues/8557" )
419+ tstest .Shard (t )
417420 tstest .ResourceCheck (t )
418421 ctx , cancel := context .WithTimeout (context .Background (), 30 * time .Second )
419422 defer cancel ()
@@ -489,6 +492,7 @@ func TestLoopbackLocalAPI(t *testing.T) {
489492
490493func TestLoopbackSOCKS5 (t * testing.T ) {
491494 flakytest .Mark (t , "https://github.com/tailscale/tailscale/issues/8198" )
495+ tstest .Shard (t )
492496 ctx , cancel := context .WithTimeout (context .Background (), 30 * time .Second )
493497 defer cancel ()
494498
@@ -539,6 +543,7 @@ func TestLoopbackSOCKS5(t *testing.T) {
539543}
540544
541545func TestTailscaleIPs (t * testing.T ) {
546+ tstest .Shard (t )
542547 controlURL , _ := startControl (t )
543548
544549 tmp := t .TempDir ()
@@ -581,6 +586,7 @@ func TestTailscaleIPs(t *testing.T) {
581586// TestListenerCleanup is a regression test to verify that s.Close doesn't
582587// deadlock if a listener is still open.
583588func TestListenerCleanup (t * testing.T ) {
589+ tstest .Shard (t )
584590 ctx , cancel := context .WithTimeout (context .Background (), 30 * time .Second )
585591 defer cancel ()
586592
@@ -623,6 +629,7 @@ func (wc *closeTrackConn) Close() error {
623629// tests https://github.com/tailscale/tailscale/issues/6973 -- that we can start a tsnet server,
624630// stop it, and restart it, even on Windows.
625631func TestStartStopStartGetsSameIP (t * testing.T ) {
632+ tstest .Shard (t )
626633 controlURL , _ := startControl (t )
627634
628635 tmp := t .TempDir ()
@@ -672,6 +679,7 @@ func TestStartStopStartGetsSameIP(t *testing.T) {
672679}
673680
674681func TestFunnel (t * testing.T ) {
682+ tstest .Shard (t )
675683 ctx , dialCancel := context .WithTimeout (context .Background (), 30 * time .Second )
676684 defer dialCancel ()
677685
@@ -733,6 +741,7 @@ func TestFunnel(t *testing.T) {
733741}
734742
735743func TestListenerClose (t * testing.T ) {
744+ tstest .Shard (t )
736745 ctx := context .Background ()
737746 controlURL , _ := startControl (t )
738747
@@ -812,6 +821,7 @@ func (c *bufferedConn) Read(b []byte) (int, error) {
812821}
813822
814823func TestFallbackTCPHandler (t * testing.T ) {
824+ tstest .Shard (t )
815825 tstest .ResourceCheck (t )
816826 ctx , cancel := context .WithTimeout (context .Background (), 30 * time .Second )
817827 defer cancel ()
@@ -854,6 +864,7 @@ func TestFallbackTCPHandler(t *testing.T) {
854864}
855865
856866func TestCapturePcap (t * testing.T ) {
867+ tstest .Shard (t )
857868 const timeLimit = 120
858869 ctx , cancel := context .WithTimeout (context .Background (), timeLimit * time .Second )
859870 defer cancel ()
@@ -907,6 +918,7 @@ func TestCapturePcap(t *testing.T) {
907918}
908919
909920func TestUDPConn (t * testing.T ) {
921+ tstest .Shard (t )
910922 tstest .ResourceCheck (t )
911923 ctx , cancel := context .WithTimeout (context .Background (), 30 * time .Second )
912924 defer cancel ()
@@ -1098,6 +1110,7 @@ func sendData(logf func(format string, args ...any), ctx context.Context, bytesC
10981110}
10991111
11001112func TestUserMetricsByteCounters (t * testing.T ) {
1113+ tstest .Shard (t )
11011114 ctx , cancel := context .WithTimeout (context .Background (), 120 * time .Second )
11021115 defer cancel ()
11031116
@@ -1212,6 +1225,7 @@ func TestUserMetricsByteCounters(t *testing.T) {
12121225}
12131226
12141227func TestUserMetricsRouteGauges (t * testing.T ) {
1228+ tstest .Shard (t )
12151229 // Windows does not seem to support or report back routes when running in
12161230 // userspace via tsnet. So, we skip this check on Windows.
12171231 // TODO(kradalby): Figure out if this is correct.
@@ -1368,6 +1382,7 @@ func mustDirect(t *testing.T, logf logger.Logf, lc1, lc2 *local.Client) {
13681382}
13691383
13701384func TestDeps (t * testing.T ) {
1385+ tstest .Shard (t )
13711386 deptest.DepChecker {
13721387 GOOS : "linux" ,
13731388 GOARCH : "amd64" ,
0 commit comments