diff --git a/test/integration/serviceaccount/service_account_test.go b/test/integration/serviceaccount/service_account_test.go index d0efb0ee4fb..bf29cff7d1e 100644 --- a/test/integration/serviceaccount/service_account_test.go +++ b/test/integration/serviceaccount/service_account_test.go @@ -30,7 +30,7 @@ import ( "testing" "time" - "k8s.io/api/core/v1" + v1 "k8s.io/api/core/v1" apiequality "k8s.io/apimachinery/pkg/api/equality" "k8s.io/apimachinery/pkg/api/errors" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" @@ -446,12 +446,13 @@ func startServiceAccountTestServer(t *testing.T) (*clientset.Clientset, restclie masterConfig.GenericConfig.Authentication.Authenticator = authenticator masterConfig.GenericConfig.Authorization.Authorizer = authorizer masterConfig.GenericConfig.AdmissionControl = serviceAccountAdmission - framework.RunAMasterUsingServer(masterConfig, apiServer, h) + _, _, kubeAPIServerCloseFn := framework.RunAMasterUsingServer(masterConfig, apiServer, h) // Start the service account and service account token controllers stopCh := make(chan struct{}) stop := func() { close(stopCh) + kubeAPIServerCloseFn() apiServer.Close() }