Skip to content

Commit

Permalink
[DBAAS-974] use proper context when starting envtest
Browse files Browse the repository at this point in the history
Signed-off-by: Tommy Hughes <tohughes@redhat.com>
  • Loading branch information
tchughesiv committed Nov 1, 2022
1 parent 3ff53ed commit 7f52fec
Showing 1 changed file with 2 additions and 8 deletions.
10 changes: 2 additions & 8 deletions controllers/suite_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -154,21 +154,15 @@ var _ = BeforeSuite(func() {

go func() {
defer GinkgoRecover()
err = k8sManager.Start(ctrl.SetupSignalHandler())
err = k8sManager.Start(ctx)
Expect(err).NotTo(HaveOccurred())
}()
}, 60)

var _ = AfterSuite(func() {
// https://github.com/kubernetes-sigs/controller-runtime/issues/1571
cancel()
By("tearing down the test environment,but I do nothing here.")
By("tearing down the test environment")
err := testEnv.Stop()
// Set 4 with random
if err != nil {
time.Sleep(4 * time.Second)
}
err = testEnv.Stop()
Expect(err).NotTo(HaveOccurred())
err = os.Unsetenv(InstallNamespaceEnvVar)
Expect(err).NotTo(HaveOccurred())
Expand Down

0 comments on commit 7f52fec

Please sign in to comment.