diff --git a/types/logger/logger_test.go b/types/logger/logger_test.go index 510207027..e91977a8f 100644 --- a/types/logger/logger_test.go +++ b/types/logger/logger_test.go @@ -15,6 +15,7 @@ import ( qt "github.com/frankban/quicktest" "tailscale.com/tailcfg" + "tailscale.com/version" ) func TestFuncWriter(t *testing.T) { @@ -238,6 +239,12 @@ func TestAsJSON(t *testing.T) { t.Errorf("for marshal error, got %#q; want %#q", got, wantErr) } + if version.IsRace() { + // skip the rest of the test in race mode; + // race mode causes more allocs which we don't care about. + return + } + var buf bytes.Buffer n := int(testing.AllocsPerRun(1000, func() { buf.Reset()