From c8f03fc3542c64d45bfe68bcf0f6f3958fb8e7b1 Mon Sep 17 00:00:00 2001 From: Daniel Smith Date: Thu, 28 May 2015 15:00:22 -0700 Subject: [PATCH] fix timeout for networking test --- test/e2e/networking.go | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) diff --git a/test/e2e/networking.go b/test/e2e/networking.go index 6bdd5cbf5ed..03cea84c515 100644 --- a/test/e2e/networking.go +++ b/test/e2e/networking.go @@ -112,9 +112,7 @@ var _ = Describe("NetworkingNew", func() { }) //Now we can proceed with the test. - It("should function for intra-pod communication", func(done Done) { - defer close(done) - + It("should function for intra-pod communication", func() { if testContext.Provider == "vagrant" { By("Skipping test which is broken for vagrant (See https://github.com/GoogleCloudPlatform/kubernetes/issues/3580)") return @@ -203,7 +201,8 @@ var _ = Describe("NetworkingNew", func() { DoRaw() } - for i := 0; !passed; i++ { // Timeout will keep us from going forever. + timeout := time.Now().Add(2 * time.Minute) + for i := 0; !passed && timeout.After(time.Now()); i++ { time.Sleep(2 * time.Second) Logf("About to make a proxy status call") start := time.Now() @@ -241,7 +240,7 @@ var _ = Describe("NetworkingNew", func() { } } Expect(string(body)).To(Equal("pass")) - }, 120) + }) }) @@ -326,9 +325,7 @@ var _ = Describe("Networking", func() { }) //Now we can proceed with the test. - It("should function for intra-pod communication", func(done Done) { - defer close(done) - + It("should function for intra-pod communication", func() { if testContext.Provider == "vagrant" { By("Skipping test which is broken for vagrant (See https://github.com/GoogleCloudPlatform/kubernetes/issues/3580)") return @@ -417,7 +414,8 @@ var _ = Describe("Networking", func() { DoRaw() } - for i := 0; !passed; i++ { // Timeout will keep us from going forever. + timeout := time.Now().Add(2 * time.Minute) + for i := 0; !passed && timeout.After(time.Now()); i++ { time.Sleep(2 * time.Second) Logf("About to make a proxy status call") start := time.Now() @@ -455,6 +453,6 @@ var _ = Describe("Networking", func() { } } Expect(string(body)).To(Equal("pass")) - }, 120) + }) })