mirror of
				https://github.com/optim-enterprises-bv/kubernetes.git
				synced 2025-11-04 04:08:16 +00:00 
			
		
		
		
	Merge pull request #126848 from carlory/ref-124136
Fix hotloop once the watch closes
This commit is contained in:
		@@ -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()
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user