Skip to content

Commit

Permalink
drainErrChan returns if channel is closed (#4314)
Browse files Browse the repository at this point in the history
  • Loading branch information
AndersonQ authored Feb 22, 2024
1 parent 2eecafb commit 00550ca
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion pkg/component/runtime/manager_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,11 @@ func newDebugLogger(t *testing.T) *logger.Logger {
func drainErrChan(ch chan error) {
for {
select {
case <-ch:
case _, ok := <-ch:
// channel is closed, nothing to drain
if !ok {
return
}
default:
return
}
Expand Down

0 comments on commit 00550ca

Please sign in to comment.