diff --git a/pkg/reconciler/inmemorychannel/dispatcher/controller_test.go b/pkg/reconciler/inmemorychannel/dispatcher/controller_test.go index d3ae50f907e..28124473694 100644 --- a/pkg/reconciler/inmemorychannel/dispatcher/controller_test.go +++ b/pkg/reconciler/inmemorychannel/dispatcher/controller_test.go @@ -30,7 +30,8 @@ import ( ) func TestNew(t *testing.T) { - ctx, _ := SetupFakeContext(t) + ctx, cancel, _ := SetupFakeContextWithCancel(t) + defer cancel() os.Setenv("SCOPE", eventing.ScopeCluster) c := NewController(ctx, &configmap.InformedWatcher{}) @@ -41,7 +42,8 @@ func TestNew(t *testing.T) { } func TestNewInNamespace(t *testing.T) { - ctx, _ := SetupFakeContext(t) + ctx, cancel, _ := SetupFakeContextWithCancel(t) + defer cancel() os.Setenv("SCOPE", eventing.ScopeNamespace) c := NewController(ctx, &configmap.InformedWatcher{})