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".
This commit is contained in:
Jan Safranek
2016-06-13 14:43:49 +02:00
parent 6489abe8b4
commit 248b4c3350

View File

@@ -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")