From f5b032ad8e045258e582dd4a659b9e15b9fdbf18 Mon Sep 17 00:00:00 2001 From: Travis Nielsen Date: Thu, 24 Oct 2019 18:54:41 -0600 Subject: [PATCH] ceph: improve reliability of mon failover test Depending on the state of the orchestration, the operator might trigger re-creation of the deleted mon. In this case, consider the test successful rather than wait for the failover which will never occur. Signed-off-by: Travis Nielsen --- tests/integration/ceph_mon_test.go | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/tests/integration/ceph_mon_test.go b/tests/integration/ceph_mon_test.go index fefa61448..624897ddc 100644 --- a/tests/integration/ceph_mon_test.go +++ b/tests/integration/ceph_mon_test.go @@ -42,6 +42,7 @@ func (suite *SmokeSuite) TestMonFailover() { require.Nil(suite.T(), err) // Wait for the health check to start a new monitor + originalMonDeleted := false for i := 0; i < 30; i++ { deployments, err := suite.k8sh.Clientset.AppsV1().Deployments(suite.namespace).List(opts) require.Nil(suite.T(), err) @@ -56,9 +57,17 @@ func (suite *SmokeSuite) TestMonFailover() { // Check if we have three monitors if foundOldMon { + if originalMonDeleted { + // Depending on the state of the orchestration, the operator might trigger + // re-creation of the deleted mon. In this case, consider the test successful + // rather than wait for the failover which will never occur. + logger.Infof("Original mon created again, no need to wait for mon failover") + return + } logger.Infof("Waiting for old monitor to stop") } else { logger.Infof("Waiting for a new monitor to start") + originalMonDeleted = true if len(deployments.Items) == 3 { var newMons []string for _, mon := range deployments.Items {