Fix swallowed errors in TestRollbackManager_Join() (#3327)

This commit is contained in:
Lars Lehtonen 2017-11-06 11:34:27 -08:00 committed by Jeff Mitchell
parent 71b5aa22e5
commit 8ccdaa1860
1 changed files with 9 additions and 3 deletions

View File

@ -81,11 +81,12 @@ func TestRollbackManager_Join(t *testing.T) {
wg := &sync.WaitGroup{}
wg.Add(3)
errCh := make(chan error, 3)
go func() {
defer wg.Done()
err := m.Rollback("foo")
if err != nil {
t.Fatalf("err: %v", err)
errCh <- err
}
}()
@ -93,7 +94,7 @@ func TestRollbackManager_Join(t *testing.T) {
defer wg.Done()
err := m.Rollback("foo")
if err != nil {
t.Fatalf("err: %v", err)
errCh <- err
}
}()
@ -101,8 +102,13 @@ func TestRollbackManager_Join(t *testing.T) {
defer wg.Done()
err := m.Rollback("foo")
if err != nil {
t.Fatalf("err: %v", err)
errCh <- err
}
}()
wg.Wait()
close(errCh)
err := <-errCh
if err != nil {
t.Fatalf("Error on rollback:%v", err)
}
}