Skip to content

Commit 7c83034

Browse files
committed
Remove use of tb.Context
Signed-off-by: Nelo-T. Wallus <[email protected]>
1 parent d041fe5 commit 7c83034

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
lines changed

test/integration/framework/server.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,8 @@ import (
4747
func StartTestServer(tb testing.TB) (kcpclientset.ClusterInterface, kcpkubernetesclientset.ClusterInterface, func()) {
4848
tb.Helper()
4949

50-
ctx, cancel := context.WithCancel(tb.Context())
50+
ctx, cancel := context.WithCancel(context.Background())
51+
tb.Cleanup(cancel)
5152

5253
kcpOptions := options.NewOptions(tb.TempDir())
5354

test/integration/framework/server_test.go

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ limitations under the License.
1717
package framework
1818

1919
import (
20+
"context"
2021
"testing"
2122

2223
"github.com/stretchr/testify/require"
@@ -34,6 +35,9 @@ func TestServer(t *testing.T) {
3435
func TestServerCreateConfigMap(t *testing.T) {
3536
_, kubeClient, _ := StartTestServer(t)
3637

38+
ctx, cancel := context.WithCancel(context.Background())
39+
t.Cleanup(cancel)
40+
3741
configmap := &corev1.ConfigMap{
3842
ObjectMeta: metav1.ObjectMeta{
3943
Name: "test",
@@ -47,6 +51,6 @@ func TestServerCreateConfigMap(t *testing.T) {
4751
_, err := kubeClient.Cluster(core.RootCluster.Path()).
4852
CoreV1().
4953
ConfigMaps(metav1.NamespaceDefault).
50-
Create(t.Context(), configmap, metav1.CreateOptions{})
54+
Create(ctx, configmap, metav1.CreateOptions{})
5155
require.Nil(t, err)
5256
}

0 commit comments

Comments
 (0)