mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-26 21:17:23 +00:00
Update name of watchEvent and comment on timeout for watch
This commit is contained in:
parent
bf4f46b9fa
commit
58c532b968
@ -2708,14 +2708,15 @@ var _ = SIGDescribe("Services", func() {
|
|||||||
}, metav1.CreateOptions{})
|
}, metav1.CreateOptions{})
|
||||||
framework.ExpectNoError(err, "failed to create Endpoint")
|
framework.ExpectNoError(err, "failed to create Endpoint")
|
||||||
|
|
||||||
// setup a watch for the Endpoint
|
// set up a watch for the Endpoint
|
||||||
|
// this timeout was chosen as there was timeout failure from the CI
|
||||||
endpointWatchTimeoutSeconds := int64(180)
|
endpointWatchTimeoutSeconds := int64(180)
|
||||||
endpointWatch, err := f.ClientSet.CoreV1().Endpoints(ns).Watch(context.TODO(), metav1.ListOptions{LabelSelector: "testendpoint-static=true", TimeoutSeconds: &endpointWatchTimeoutSeconds})
|
endpointWatch, err := f.ClientSet.CoreV1().Endpoints(ns).Watch(context.TODO(), metav1.ListOptions{LabelSelector: "testendpoint-static=true", TimeoutSeconds: &endpointWatchTimeoutSeconds})
|
||||||
framework.ExpectNoError(err, "failed to setup watch on newly created Endpoint")
|
framework.ExpectNoError(err, "failed to setup watch on newly created Endpoint")
|
||||||
endpointWatchChan := endpointWatch.ResultChan()
|
endpointWatchChan := endpointWatch.ResultChan()
|
||||||
ginkgo.By("waiting for available Endpoint")
|
ginkgo.By("waiting for available Endpoint")
|
||||||
for event := range endpointWatchChan {
|
for watchEvent := range endpointWatchChan {
|
||||||
if event.Type == "ADDED" {
|
if watchEvent.Type == "ADDED" {
|
||||||
break
|
break
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -2766,7 +2767,7 @@ var _ = SIGDescribe("Services", func() {
|
|||||||
},
|
},
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
framework.ExpectNoError(err, "failed to marshal JSON for Event patch")
|
framework.ExpectNoError(err, "failed to marshal JSON for WatchEvent patch")
|
||||||
ginkgo.By("patching the Endpoint")
|
ginkgo.By("patching the Endpoint")
|
||||||
_, err = f.ClientSet.CoreV1().Endpoints(ns).Patch(context.TODO(), testEndpointName, types.StrategicMergePatchType, []byte(endpointPatch), metav1.PatchOptions{})
|
_, err = f.ClientSet.CoreV1().Endpoints(ns).Patch(context.TODO(), testEndpointName, types.StrategicMergePatchType, []byte(endpointPatch), metav1.PatchOptions{})
|
||||||
framework.ExpectNoError(err, "failed to patch Endpoint")
|
framework.ExpectNoError(err, "failed to patch Endpoint")
|
||||||
@ -2787,8 +2788,8 @@ var _ = SIGDescribe("Services", func() {
|
|||||||
framework.ExpectNoError(err, "failed to delete Endpoint by Collection")
|
framework.ExpectNoError(err, "failed to delete Endpoint by Collection")
|
||||||
|
|
||||||
ginkgo.By("waiting for Endpoint deletion")
|
ginkgo.By("waiting for Endpoint deletion")
|
||||||
for event := range endpointWatchChan {
|
for watchEvent := range endpointWatchChan {
|
||||||
if event.Type == "DELETED" {
|
if watchEvent.Type == "DELETED" {
|
||||||
break
|
break
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user