tailscale/tstest/largetailnet
Brad Fitzpatrick 94af1b00fb cmd/testwrapper, tstest: move test sharding out of test code
Previously, sharding required tests to opt in by calling tstest.Shard,
which used a process-global counter to assign each test to a shard.
This had two problems: most tests didn't call it, so they ran on every
shard (defeating the purpose), and shard assignments were unstable
(depended on call order, so adding a test could reshuffle others).

Remove tstest.Shard and tstest.SkipOnUnshardedCI entirely. Instead,
have testwrapper implement sharding automatically for all tests: when
TS_TEST_SHARD=N/M is set, it uses "go list -json" (no compilation) to
find test source files, scans them for top-level Test/Benchmark/
Example/Fuzz function names, and filters by fnv32a(name) % M == N-1.
The filtered names are passed as an anchored -run regex to go test.

Using go list instead of "go test -list" avoids linking the test binary
twice (Go's build cache does not cache test binary linking).

Fixes #19886

Change-Id: I62ab7b3d757324d4c5fd0b5de50c1e3742681791
Signed-off-by: Brad Fitzpatrick <bradfitz@tailscale.com>
2026-05-27 16:53:17 -07:00
..
delta_test.go cmd/testwrapper, tstest: move test sharding out of test code 2026-05-27 16:53:17 -07:00
largetailnet_test.go ipn/ipnlocal, control/controlclient: process node adds/removes in constant time 2026-05-21 09:26:19 -07:00
largetailnet.go tstest/largetailnet, tstest/integration/testcontrol: add in-process large-tailnet benchmark 2026-04-27 11:47:12 -07:00