diff --git a/e2e/fixtures/factory.go b/e2e/fixtures/factory.go index 684c4ca25..ec6d08b0a 100644 --- a/e2e/fixtures/factory.go +++ b/e2e/fixtures/factory.go @@ -309,11 +309,14 @@ func (factory *Factory) Shutdown() { time.Sleep(15 * time.Second) err := factory.CleanupChaosMeshExperiments() if err != nil { - return + log.Println("Could not delete chaos mesh experiments", err.Error()) } + log.Println("Calling", len(factory.invariantShutdownHooks.handlers), "invariantShutdownHooks") factory.invariantShutdownHooks.InvokeShutdownHandlers() + log.Println("Calling", len(factory.invariantShutdownHooks.handlers), "shutdownHooks") factory.shutdownHooks.InvokeShutdownHandlers() + log.Println("Shutdown is done") factory.shutdownInProgress = false } diff --git a/e2e/fixtures/fixtures.go b/e2e/fixtures/fixtures.go index 3e753f659..0e34631bb 100644 --- a/e2e/fixtures/fixtures.go +++ b/e2e/fixtures/fixtures.go @@ -55,7 +55,7 @@ func (shutdown *ShutdownHooks) InvokeShutdownHandlers() { // we are doing any checks. If the below Expect expression is false the further execution will be stopped and // the handler would never be reset. handler := shutdown.handlers - // clear handlers so we can be reused. + // clear handlers so it can be reused. shutdown.handlers = []func() error{} // iterate over the array in reverse order. for i := len(handler); i != 0; i-- { diff --git a/e2e/test_operator_plugin/operator_plugin_test.go b/e2e/test_operator_plugin/operator_plugin_test.go index 68f8b3df2..d4599bcab 100644 --- a/e2e/test_operator_plugin/operator_plugin_test.go +++ b/e2e/test_operator_plugin/operator_plugin_test.go @@ -65,12 +65,6 @@ var _ = AfterSuite(func() { }) var _ = Describe("Operator Plugin", Label("e2e", "pr"), func() { - AfterEach(func() { - if CurrentSpecReport().Failed() { - factory.DumpStateHaCluster(fdbCluster) - } - }) - When("getting the plugin version from the operator pod", func() { It("should print the version", func() { // Pick one operator pod and execute the kubectl version command to ensure that kubectl-fdb is present @@ -141,8 +135,9 @@ var _ = Describe("Operator Plugin", Label("e2e", "pr"), func() { AfterEach(func() { log.Println("Recreate cluster") // Delete the broken cluster. - fdbCluster.Delete() + factory.Shutdown() // Recreate the cluster to make sure the next tests can proceed + factory = fixtures.CreateFactory(testOptions) fdbCluster = factory.CreateFdbHaCluster(clusterConfig, clusterOptions...) }) @@ -185,6 +180,10 @@ var _ = Describe("Operator Plugin", Label("e2e", "pr"), func() { } Expect(errGroup.Wait()).NotTo(HaveOccurred()) + for _, cluster := range fdbCluster.GetAllClusters() { + Expect(cluster.GetCluster().UseDNSInClusterFile()).To(BeTrue()) + } + // This tests is a destructive test where the cluster will stop working for some period. primary := fdbCluster.GetPrimary() primary.SetSkipReconciliation(true) @@ -239,8 +238,9 @@ var _ = Describe("Operator Plugin", Label("e2e", "pr"), func() { AfterEach(func() { log.Println("Recreate cluster") // Delete the broken cluster. - fdbCluster.Delete() + factory.Shutdown() // Recreate the cluster to make sure the next tests can proceed + factory = fixtures.CreateFactory(testOptions) fdbCluster = factory.CreateFdbHaCluster(clusterConfig, clusterOptions...) })