From 5e442802c042287098f97057d69b92eae8bf7325 Mon Sep 17 00:00:00 2001 From: Ross Light Date: Tue, 3 Jul 2018 14:11:35 -0700 Subject: [PATCH] wire: fix test data race (google/go-cloud#168) This was introduced in 7d83fb8532c1455d4e81b587f31d090320f5eb9f and is surprisingly not caught by the race detector. I suspect that the testing package makes it not a strict data race, but the result is still undefined. --- internal/wire/wire_test.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/internal/wire/wire_test.go b/internal/wire/wire_test.go index 6cee039..370ac21 100644 --- a/internal/wire/wire_test.go +++ b/internal/wire/wire_test.go @@ -67,6 +67,7 @@ func TestWire(t *testing.T) { t.Skip("go toolchain not available:", err) } for _, test := range tests { + test := test t.Run(test.name, func(t *testing.T) { t.Parallel() bctx := test.buildContext() @@ -137,6 +138,7 @@ func TestWire(t *testing.T) { if test.wantError { continue } + test := test t.Run(test.name, func(t *testing.T) { t.Parallel() bctx := test.buildContext()