types/logger: fix test failure I missed earlier

I didn't see the race builder fail on CI earlier in 590c693b9.
This fixes the test.

Updates #greenci

Change-Id: I9f271bfadfc29b010226b55bf6647f35f03730b1
Signed-off-by: Brad Fitzpatrick <bradfitz@tailscale.com>
This commit is contained in:
Brad Fitzpatrick 2023-08-28 20:43:28 -07:00 committed by Brad Fitzpatrick
parent 590c693b96
commit a64593d7ef

View File

@ -15,6 +15,7 @@
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()