From 9855db09bd681c16506d23eb239bb90c92eb4c47 Mon Sep 17 00:00:00 2001 From: Travis Nielsen Date: Mon, 3 Feb 2020 20:54:53 -0700 Subject: [PATCH] ceph: describe file-test pod upon failure to terminate The file-test consumer pod intermittently fails to stop during the integration tests. When this happens, print the pod description to see if there are events indicating the issue. Signed-off-by: Travis Nielsen --- tests/integration/ceph_base_file_test.go | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/tests/integration/ceph_base_file_test.go b/tests/integration/ceph_base_file_test.go index 039fbb990..68d851cfa 100644 --- a/tests/integration/ceph_base_file_test.go +++ b/tests/integration/ceph_base_file_test.go @@ -112,8 +112,11 @@ func downscaleMetadataServers(helper *clients.TestClient, k8sh *utils.K8sHelper, func cleanupFilesystemConsumer(k8sh *utils.K8sHelper, s suite.Suite, namespace string, podName string) { logger.Infof("Delete file System consumer") err := k8sh.DeletePod(namespace, podName) - require.Nil(s.T(), err) - require.True(s.T(), k8sh.IsPodTerminated(podName, namespace), fmt.Sprintf("make sure %s pod is terminated", podName)) + assert.Nil(s.T(), err) + if !k8sh.IsPodTerminated(podName, namespace) { + k8sh.PrintPodDescribe(namespace, podName) + assert.Fail(s.T(), fmt.Sprintf("make sure %s pod is terminated", podName)) + } logger.Infof("File system consumer deleted") } @@ -121,7 +124,7 @@ func cleanupFilesystemConsumer(k8sh *utils.K8sHelper, s suite.Suite, namespace s func cleanupFilesystem(helper *clients.TestClient, k8sh *utils.K8sHelper, s suite.Suite, namespace string, filesystemName string) { logger.Infof("Deleting file system") err := helper.FSClient.Delete(filesystemName, namespace) - require.Nil(s.T(), err) + assert.Nil(s.T(), err) logger.Infof("File system %s deleted", filesystemName) }