From cd56b041f3b5c449ff34b2befe9ac722b7390ca5 Mon Sep 17 00:00:00 2001 From: saadali Date: Mon, 21 Sep 2015 19:21:06 -0700 Subject: [PATCH] Fix #14284: TestPersistentVolumeClaimBinder flake --- test/integration/persistent_volumes_test.go | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/test/integration/persistent_volumes_test.go b/test/integration/persistent_volumes_test.go index a886868cc24..f35852329c3 100644 --- a/test/integration/persistent_volumes_test.go +++ b/test/integration/persistent_volumes_test.go @@ -86,16 +86,18 @@ func TestPersistentVolumeClaimBinder(t *testing.T) { } defer watch.Stop() - boundCount := 0 - expectedBoundCount := 2 - for { + // Wait for claim01 and claim02 to become bound + claim01Pending := true + claim02Pending := true + for claim01Pending || claim02Pending { event := <-watch.ResultChan() claim := event.Object.(*api.PersistentVolumeClaim) - if claim.Spec.VolumeName != "" { - boundCount++ - } - if boundCount == expectedBoundCount { - break + if claim.Spec.VolumeName != "" && claim.Status.Phase != "Bound" { + if claim.Name == "claim01" { + claim01Pending = false + } else if claim.Name == "claim02" { + claim02Pending = false + } } }