Skip to content

Commit

Permalink
Merge pull request #276 from leakingtapan/fix-e2e
Browse files Browse the repository at this point in the history
Fix e2e test when pod start times out
  • Loading branch information
Cheng Pan committed Apr 9, 2019
2 parents c67ab06 + aaed6f7 commit 596c4fd
Showing 1 changed file with 3 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@ type DynamicallyProvisionedCollocatedPodTest struct {

func (t *DynamicallyProvisionedCollocatedPodTest) Run(client clientset.Interface, namespace *v1.Namespace) {
nodeName := ""
podCleanup := make([]func(), 0)
for _, pod := range t.Pods {
tpod, cleanup := pod.SetupWithDynamicVolumes(client, namespace, t.CSIDriver)
if t.ColocatePods && nodeName != "" {
Expand All @@ -47,13 +46,11 @@ func (t *DynamicallyProvisionedCollocatedPodTest) Run(client clientset.Interface

By("deploying the pod")
tpod.Create()
podCleanup = append(podCleanup, tpod.Cleanup)
defer tpod.Cleanup()

By("checking that the pod is running")
tpod.WaitForRunning()
nodeName = tpod.pod.Spec.NodeName
}
// call Pod cleanup after all pods are up
for i := range podCleanup {
podCleanup[i]()
}

}

0 comments on commit 596c4fd

Please sign in to comment.