This repository was archived by the owner on Apr 17, 2025. It is now read-only.
File tree Expand file tree Collapse file tree 1 file changed +10
-3
lines changed Expand file tree Collapse file tree 1 file changed +10
-3
lines changed Original file line number Diff line number Diff line change @@ -16,6 +16,7 @@ limitations under the License.
16
16
package integtest
17
17
18
18
import (
19
+ "context"
19
20
"path/filepath"
20
21
"testing"
21
22
"time"
@@ -44,8 +45,9 @@ import (
44
45
// http://onsi.github.io/ginkgo/ to learn more about Ginkgo.
45
46
46
47
var (
47
- K8sClient client.Client
48
- testEnv * envtest.Environment
48
+ K8sClient client.Client
49
+ testEnv * envtest.Environment
50
+ k8sManagerCancelFn context.CancelFunc
49
51
)
50
52
51
53
func HNCRun (t * testing.T , title string ) {
@@ -108,12 +110,17 @@ func HNCBeforeSuite() {
108
110
Expect (K8sClient ).ToNot (BeNil ())
109
111
110
112
go func () {
111
- err = k8sManager .Start (ctrl .SetupSignalHandler ())
113
+ var ctx context.Context
114
+ ctx , k8sManagerCancelFn = context .WithCancel (ctrl .SetupSignalHandler ())
115
+ err = k8sManager .Start (ctx )
112
116
Expect (err ).ToNot (HaveOccurred ())
113
117
}()
114
118
}
115
119
116
120
func HNCAfterSuite () {
121
+ if k8sManagerCancelFn != nil {
122
+ k8sManagerCancelFn ()
123
+ }
117
124
By ("tearing down the test environment" )
118
125
Expect (testEnv ).ToNot (BeNil ())
119
126
err := testEnv .Stop ()
You can’t perform that action at this time.
0 commit comments