Skip to content

Commit 00550ca

Browse files
authoredFeb 22, 2024
drainErrChan returns if channel is closed (#4314)
1 parent 2eecafb commit 00550ca

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed
 

‎pkg/component/runtime/manager_test.go

+5-1
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,11 @@ func newDebugLogger(t *testing.T) *logger.Logger {
141141
func drainErrChan(ch chan error) {
142142
for {
143143
select {
144-
case <-ch:
144+
case _, ok := <-ch:
145+
// channel is closed, nothing to drain
146+
if !ok {
147+
return
148+
}
145149
default:
146150
return
147151
}

0 commit comments

Comments
 (0)