Skip to content

Commit f3a06c0

Browse files
authored
Merge pull request hashicorp#7978 from hashicorp/jbardin/races
Fix improper wait group usage in test
2 parents a51a2c1 + bb84dc7 commit f3a06c0

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

builtin/providers/template/datasource_template_file_test.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -122,8 +122,8 @@ func TestValidateVarsAttribute(t *testing.T) {
122122
func TestTemplateSharedMemoryRace(t *testing.T) {
123123
var wg sync.WaitGroup
124124
for i := 0; i < 100; i++ {
125-
go func(wg *sync.WaitGroup, t *testing.T, i int) {
126-
wg.Add(1)
125+
wg.Add(1)
126+
go func(t *testing.T, i int) {
127127
out, err := execute("don't panic!", map[string]interface{}{})
128128
if err != nil {
129129
t.Fatalf("err: %s", err)
@@ -132,7 +132,7 @@ func TestTemplateSharedMemoryRace(t *testing.T) {
132132
t.Fatalf("bad output: %s", out)
133133
}
134134
wg.Done()
135-
}(&wg, t, i)
135+
}(t, i)
136136
}
137137
wg.Wait()
138138
}

0 commit comments

Comments
 (0)