From 248b4c335057233a2c82702a6f6af46544e460b6 Mon Sep 17 00:00:00 2001 From: Jan Safranek Date: Mon, 13 Jun 2016 14:43:49 +0200 Subject: [PATCH] volume integration: wait for PVs before creating PVCs The test should wait until all volumes are processed by volume controller (i.e. in the controller cache) before creating a PVC. Without that, the "best" matching PV could not be in the cache and controller might bind the PVC to suboptiomal one. This fixes integration test flake "Bind mismatch! Expected pvc-2 capacity 50000000000 but got pvc-2 capacity 52000000000". --- test/integration/persistent_volumes_test.go | 1 + 1 file changed, 1 insertion(+) diff --git a/test/integration/persistent_volumes_test.go b/test/integration/persistent_volumes_test.go index 198c6295028..a8817f7015e 100644 --- a/test/integration/persistent_volumes_test.go +++ b/test/integration/persistent_volumes_test.go @@ -250,6 +250,7 @@ func TestPersistentVolumeMultiPVs(t *testing.T) { if err != nil { t.Errorf("Failed to create PersistentVolume %d: %v", i, err) } + waitForPersistentVolumePhase(testClient, pvs[i].Name, watchPV, api.VolumeAvailable) } t.Log("volumes created")