Skip to content

Commit

Permalink
Fix swallowed errors in TestRollbackManager_Join() (#3327)
Browse files Browse the repository at this point in the history
  • Loading branch information
alrs authored and jefferai committed Nov 6, 2017
1 parent b490018 commit 5fea9df
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions vault/rollback_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -81,28 +81,34 @@ 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
}
}()

go func() {
defer wg.Done()
err := m.Rollback("foo")
if err != nil {
t.Fatalf("err: %v", err)
errCh <- err
}
}()

go func() {
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)
}
}

0 comments on commit 5fea9df

Please sign in to comment.