Merge pull request #126848 from carlory/ref-124136

Fix hotloop once the watch closes
This commit is contained in:
Kubernetes Prow Robot 2024-08-22 16:32:24 +01:00 committed by GitHub
commit e855753ca6
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -1068,7 +1068,16 @@ func TestPersistentVolumeProvisionMultiPVCs(t *testing.T) {
}
for {
select {
case event := <-w.ResultChan():
case event, ok := <-w.ResultChan():
if !ok {
klog.Info("Event watch channel closed")
w, err = testClient.EventsV1().Events(ns.Name).Watch(tCtx, metav1.ListOptions{})
if err != nil {
klog.ErrorS(err, "Failed to restart event watch")
return
}
continue
}
reportToArtifacts(t.Name()+"-events.text", event.Object)
case <-tCtx.Done():
w.Stop()