Fix improper wait group usage in test

This commit is contained in:
James Bardin 2016-08-04 11:20:11 -04:00
parent 98d8440711
commit bb84dc75b7
1 changed files with 3 additions and 3 deletions

View File

@ -122,8 +122,8 @@ func TestValidateVarsAttribute(t *testing.T) {
func TestTemplateSharedMemoryRace(t *testing.T) {
var wg sync.WaitGroup
for i := 0; i < 100; i++ {
go func(wg *sync.WaitGroup, t *testing.T, i int) {
wg.Add(1)
wg.Add(1)
go func(t *testing.T, i int) {
out, err := execute("don't panic!", map[string]interface{}{})
if err != nil {
t.Fatalf("err: %s", err)
@ -132,7 +132,7 @@ func TestTemplateSharedMemoryRace(t *testing.T) {
t.Fatalf("bad output: %s", out)
}
wg.Done()
}(&wg, t, i)
}(t, i)
}
wg.Wait()
}