Skip to content

Commit

Permalink
don't panic
Browse files Browse the repository at this point in the history
Signed-off-by: Carolyn Van Slyck <[email protected]>
  • Loading branch information
carolynvs committed Aug 3, 2021
1 parent 100be2f commit 1d9dad2
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions pkg/test/logger.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,12 @@ type Logger struct {
}

func (l Logger) Write(p []byte) (n int, err error) {
defer func() {
if err := recover; err != nil {
// ignore logs written after the test is complete, don't panic
}
}()

l.T.Log(string(p))
return len(p), nil
}

0 comments on commit 1d9dad2

Please sign in to comment.