From 51c218ea7d74fbd9969a34cc3941cc7a03688b0d Mon Sep 17 00:00:00 2001 From: Jan Safranek Date: Mon, 6 Jun 2016 14:37:21 +0200 Subject: [PATCH] Fix volume integration test flake When we create a PV, we should created it withoud Spec.ClaimRef.UID. In rare cases, when 'PV added' event with UID is processed before 'PVC added' (created by for loop few lines above), the controller does not know a PVC with this UID and considers the PV as released. Reclaim policy is then executed and the PV is deleted and it's never bound. With UID="", the controller waits for the PVC to get created and binds it. --- 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 920cbe8cf9f..a91a153ca93 100644 --- a/test/integration/persistent_volumes_test.go +++ b/test/integration/persistent_volumes_test.go @@ -242,6 +242,7 @@ func TestPersistentVolumeBindRace(t *testing.T) { t.Fatalf("Unexpected error getting claimRef: %v", err) } pv.Spec.ClaimRef = claimRef + pv.Spec.ClaimRef.UID = "" pv, err = testClient.PersistentVolumes().Create(pv) if err != nil {