diff --git a/test/integration/util/util.go b/test/integration/util/util.go index f05df65660b..7de4df06bd9 100644 --- a/test/integration/util/util.go +++ b/test/integration/util/util.go @@ -350,29 +350,25 @@ func InitTestAPIServer(t *testing.T, nsPrefix string, admission admission.Interf } // 1. Create API server - h := &framework.APIServerHolder{Initialized: make(chan struct{})} - s := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, req *http.Request) { - <-h.Initialized - h.M.GenericAPIServer.Handler.ServeHTTP(w, req) - })) - controlPlaneConfig := framework.NewIntegrationTestControlPlaneConfig() if admission != nil { controlPlaneConfig.GenericConfig.AdmissionControl = admission } - _, testCtx.HTTPServer, testCtx.CloseFn = framework.RunAnAPIServerUsingServer(controlPlaneConfig, s, h) + _, testCtx.HTTPServer, testCtx.CloseFn = framework.RunAnAPIServer(controlPlaneConfig) if nsPrefix != "default" { - testCtx.NS = framework.CreateTestingNamespace(nsPrefix+string(uuid.NewUUID()), s, t) + testCtx.NS = framework.CreateTestingNamespace(nsPrefix+string(uuid.NewUUID()), testCtx.HTTPServer, t) } else { - testCtx.NS = framework.CreateTestingNamespace("default", s, t) + testCtx.NS = framework.CreateTestingNamespace("default", testCtx.HTTPServer, t) } // 2. Create kubeclient kubeConfig := &restclient.Config{ - QPS: -1, Host: s.URL, + QPS: 100, + Burst: 100, + Host: testCtx.HTTPServer.URL, ContentConfig: restclient.ContentConfig{ GroupVersion: &schema.GroupVersion{Group: "", Version: "v1"}, },