mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-08-06 18:54:06 +00:00
Merge pull request #126848 from carlory/ref-124136
Fix hotloop once the watch closes
This commit is contained in:
commit
e855753ca6
@ -1068,7 +1068,16 @@ func TestPersistentVolumeProvisionMultiPVCs(t *testing.T) {
|
|||||||
}
|
}
|
||||||
for {
|
for {
|
||||||
select {
|
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)
|
reportToArtifacts(t.Name()+"-events.text", event.Object)
|
||||||
case <-tCtx.Done():
|
case <-tCtx.Done():
|
||||||
w.Stop()
|
w.Stop()
|
||||||
|
Loading…
Reference in New Issue
Block a user