File tree 2 files changed +7
-2
lines changed
test/integration/framework
2 files changed +7
-2
lines changed Original file line number Diff line number Diff line change @@ -47,7 +47,8 @@ import (
47
47
func StartTestServer (tb testing.TB ) (kcpclientset.ClusterInterface , kcpkubernetesclientset.ClusterInterface , func ()) {
48
48
tb .Helper ()
49
49
50
- ctx , cancel := context .WithCancel (tb .Context ())
50
+ ctx , cancel := context .WithCancel (context .Background ())
51
+ tb .Cleanup (cancel )
51
52
52
53
kcpOptions := options .NewOptions (tb .TempDir ())
53
54
Original file line number Diff line number Diff line change @@ -17,6 +17,7 @@ limitations under the License.
17
17
package framework
18
18
19
19
import (
20
+ "context"
20
21
"testing"
21
22
22
23
"github.com/stretchr/testify/require"
@@ -34,6 +35,9 @@ func TestServer(t *testing.T) {
34
35
func TestServerCreateConfigMap (t * testing.T ) {
35
36
_ , kubeClient , _ := StartTestServer (t )
36
37
38
+ ctx , cancel := context .WithCancel (context .Background ())
39
+ t .Cleanup (cancel )
40
+
37
41
configmap := & corev1.ConfigMap {
38
42
ObjectMeta : metav1.ObjectMeta {
39
43
Name : "test" ,
@@ -47,6 +51,6 @@ func TestServerCreateConfigMap(t *testing.T) {
47
51
_ , err := kubeClient .Cluster (core .RootCluster .Path ()).
48
52
CoreV1 ().
49
53
ConfigMaps (metav1 .NamespaceDefault ).
50
- Create (t . Context () , configmap , metav1.CreateOptions {})
54
+ Create (ctx , configmap , metav1.CreateOptions {})
51
55
require .Nil (t , err )
52
56
}
You can’t perform that action at this time.
0 commit comments