mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-08-05 10:19:50 +00:00
Merge pull request #24570 from hongchaodeng/w
Automatic merge from submit-queue watcher test: print more info for debugging ref: #24528 This will print out more info to dig out the root cause.
This commit is contained in:
commit
f8d4f6157f
@ -199,9 +199,16 @@ func testCheckResult(t *testing.T, i int, expectEventType watch.EventType, w wat
|
|||||||
|
|
||||||
func testCheckStop(t *testing.T, i int, w watch.Interface) {
|
func testCheckStop(t *testing.T, i int, w watch.Interface) {
|
||||||
select {
|
select {
|
||||||
case _, ok := <-w.ResultChan():
|
case e, ok := <-w.ResultChan():
|
||||||
if ok {
|
if ok {
|
||||||
t.Errorf("#%d: ResultChan should have been closed", i)
|
var obj string
|
||||||
|
switch e.Object.(type) {
|
||||||
|
case *api.Pod:
|
||||||
|
obj = e.Object.(*api.Pod).Name
|
||||||
|
case *unversioned.Status:
|
||||||
|
obj = e.Object.(*unversioned.Status).Message
|
||||||
|
}
|
||||||
|
t.Errorf("#%d: ResultChan should have been closed. Event: %s. Object: %s", i, e.Type, obj)
|
||||||
}
|
}
|
||||||
case <-time.After(wait.ForeverTestTimeout):
|
case <-time.After(wait.ForeverTestTimeout):
|
||||||
t.Errorf("#%d: time out after waiting 1s on ResultChan", i)
|
t.Errorf("#%d: time out after waiting 1s on ResultChan", i)
|
||||||
|
Loading…
Reference in New Issue
Block a user