Additional timeout to receive all watchEvents

Kubernetes-commit: f6b527cb54e37513bbe60edb52890f3de481d000
This commit is contained in:
Abhishek Kr Srivastav 2025-01-31 10:19:19 +05:30 committed by Kubernetes Publisher
parent 2ce508cc43
commit 55da1afddb
1 changed files with 3 additions and 3 deletions

View File

@ -189,9 +189,9 @@ func testCheckResultWithIgnoreFunc(t *testing.T, w watch.Interface, expectedEven
} else {
t.Fatalf("cannot receive correct event, expect no event, but get a event: %+v", event)
}
case <-time.After(100 * time.Millisecond):
// wait 100ms forcibly in order to receive watchEvents including bookmark event.
// we cannot guarantee that we will receive all bookmark events within 100ms,
case <-time.After(150 * time.Millisecond):
// wait 150ms forcibly in order to receive watchEvents including bookmark event.
// we cannot guarantee that we will receive all bookmark events within 150ms,
// but too large timeout value will lead to exceed the timeout of package test.
if checkIndex < len(expectedEvents) {
t.Fatalf("cannot receive enough events within specific time, rest expected events: %+v", expectedEvents[checkIndex:])