From 2430c48c104fd99ce02e14bf1b5d63d40bffea9f Mon Sep 17 00:00:00 2001 From: Jan Safranek Date: Tue, 11 Feb 2020 12:54:38 +0100 Subject: [PATCH] Delete pod in volume tests All storage e2e tests should delete pods they use so we can identify issues on volume cleanup easily. --- test/e2e/framework/volume/fixtures.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/test/e2e/framework/volume/fixtures.go b/test/e2e/framework/volume/fixtures.go index 30d0000f75d..73667eedbec 100644 --- a/test/e2e/framework/volume/fixtures.go +++ b/test/e2e/framework/volume/fixtures.go @@ -486,8 +486,12 @@ func TestVolumeClient(f *framework.Framework, config TestConfig, fsGroup *int64, clientPod, err := runVolumeTesterPod(f.ClientSet, config, "client", false, fsGroup, tests) if err != nil { framework.Failf("Failed to create client pod: %v", err) - } + defer func() { + e2epod.DeletePodOrFail(f.ClientSet, clientPod.Namespace, clientPod.Name) + e2epod.WaitForPodToDisappear(f.ClientSet, clientPod.Namespace, clientPod.Name, labels.Everything(), framework.Poll, framework.PodDeleteTimeout) + }() + framework.ExpectNoError(e2epod.WaitForPodRunningInNamespace(f.ClientSet, clientPod)) testVolumeContent(f, clientPod, fsGroup, fsType, tests) }