mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-08-27 12:31:23 +00:00
Merge pull request #122127 from dcbw/e2e-openapi-timeout
e2e/openapi: fix test panic when OpenAPI CRD doesn't show up within timeout
This commit is contained in:
commit
214d664e88
@ -134,13 +134,14 @@ var _ = SIGDescribe("OpenAPIV3", func() {
|
||||
c := openapi3.NewRoot(f.ClientSet.Discovery().OpenAPIV3())
|
||||
var openAPISpec *spec3.OpenAPI
|
||||
// Poll for the OpenAPI to be updated with the new CRD
|
||||
wait.Poll(time.Second*1, wait.ForeverTestTimeout, func() (bool, error) {
|
||||
err = wait.PollUntilContextTimeout(context.Background(), time.Second*1, wait.ForeverTestTimeout, false, func(context.Context) (bool, error) {
|
||||
openAPISpec, err = c.GVSpec(gv)
|
||||
if err == nil {
|
||||
return true, nil
|
||||
}
|
||||
return false, nil
|
||||
})
|
||||
framework.ExpectNoError(err, "timed out getting new CustomResourceDefinition")
|
||||
|
||||
specMarshalled, err := json.Marshal(openAPISpec)
|
||||
framework.ExpectNoError(err)
|
||||
|
Loading…
Reference in New Issue
Block a user