Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion e2e/fixtures/factory.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}

Expand Down
2 changes: 1 addition & 1 deletion e2e/fixtures/fixtures.go
Original file line number Diff line number Diff line change
Expand Up @@ -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-- {
Expand Down
16 changes: 8 additions & 8 deletions e2e/test_operator_plugin/operator_plugin_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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...)
})

Expand Down Expand Up @@ -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)
Expand Down Expand Up @@ -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...)
})

Expand Down
Loading