From a64593d7ef39502c8af9d964807198b56a47d9c0 Mon Sep 17 00:00:00 2001 From: Brad Fitzpatrick Date: Mon, 28 Aug 2023 20:43:28 -0700 Subject: [PATCH] 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 --- types/logger/logger_test.go | 7 +++++++ 1 file changed, 7 insertions(+) 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 @@ 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()