mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-23 11:50:44 +00:00
fix e2e
Signed-off-by: carlory <baofa.fan@daocloud.io>
This commit is contained in:
parent
ab4389f174
commit
77de0b99c2
@ -25,6 +25,7 @@ import (
|
|||||||
|
|
||||||
"github.com/onsi/ginkgo/v2"
|
"github.com/onsi/ginkgo/v2"
|
||||||
"github.com/onsi/gomega"
|
"github.com/onsi/gomega"
|
||||||
|
apierrors "k8s.io/apimachinery/pkg/api/errors"
|
||||||
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||||
"k8s.io/kubernetes/test/e2e/feature"
|
"k8s.io/kubernetes/test/e2e/feature"
|
||||||
"k8s.io/kubernetes/test/e2e/framework"
|
"k8s.io/kubernetes/test/e2e/framework"
|
||||||
@ -66,22 +67,27 @@ var _ = utils.SIGDescribe("CSI Mock when kubelet restart", feature.Kind, framewo
|
|||||||
framework.ExpectNoError(err, "failed to get PVC %s", pvc.Name)
|
framework.ExpectNoError(err, "failed to get PVC %s", pvc.Name)
|
||||||
gomega.Expect(pvc.DeletionTimestamp).NotTo(gomega.BeNil(), "PVC %s should have deletion timestamp", pvc.Name)
|
gomega.Expect(pvc.DeletionTimestamp).NotTo(gomega.BeNil(), "PVC %s should have deletion timestamp", pvc.Name)
|
||||||
|
|
||||||
// FIXME: the expected behavior is no NodeUnpublishVolume call is made during kubelet restart
|
ginkgo.By(fmt.Sprintf("Verifying that the driver didn't receive NodeUnpublishVolume call for PVC %s", pvc.Name))
|
||||||
ginkgo.By(fmt.Sprintf("Verifying that the driver received NodeUnpublishVolume call for PVC %s", pvc.Name))
|
gomega.Consistently(ctx,
|
||||||
gomega.Eventually(ctx, m.driver.GetCalls).
|
func(ctx context.Context) interface{} {
|
||||||
|
calls, err := m.driver.GetCalls(ctx)
|
||||||
|
if err != nil {
|
||||||
|
if apierrors.IsUnexpectedServerError(err) {
|
||||||
|
// kubelet might not be ready yet when getting the calls
|
||||||
|
gomega.TryAgainAfter(framework.Poll).Wrap(err).Now()
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
return calls
|
||||||
|
}).
|
||||||
WithPolling(framework.Poll).
|
WithPolling(framework.Poll).
|
||||||
WithTimeout(framework.RestartNodeReadyAgainTimeout).
|
WithTimeout(framework.ClaimProvisionShortTimeout).
|
||||||
Should(gomega.ContainElement(gomega.HaveField("Method", gomega.Equal("NodeUnpublishVolume"))))
|
ShouldNot(gomega.ContainElement(gomega.HaveField("Method", gomega.Equal("NodeUnpublishVolume"))))
|
||||||
|
|
||||||
// ginkgo.By(fmt.Sprintf("Verifying that the driver didn't receive NodeUnpublishVolume call for PVC %s", pvc.Name))
|
ginkgo.By("Verifying the Pod is still running")
|
||||||
// gomega.Consistently(ctx, m.driver.GetCalls).
|
err = e2epod.WaitForPodRunningInNamespace(ctx, f.ClientSet, pod)
|
||||||
// WithPolling(framework.Poll).
|
framework.ExpectNoError(err, "failed to wait for pod %s to be running", pod.Name)
|
||||||
// WithTimeout(framework.ClaimProvisionShortTimeout).
|
|
||||||
// ShouldNot(gomega.ContainElement(gomega.HaveField("Method", gomega.Equal("NodeUnpublishVolume"))))
|
|
||||||
|
|
||||||
// ginkgo.By("Verifying the Pod is still running")
|
|
||||||
// err = e2epod.WaitForPodRunningInNamespace(ctx, f.ClientSet, pod)
|
|
||||||
// framework.ExpectNoError(err, "failed to wait for pod %s to be running", pod.Name)
|
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user