Commit b4ee63f6 authored by k8s-merge-robot's avatar k8s-merge-robot Committed by GitHub

Merge pull request #28468 from wojtek-t/integration_namespace_2

Automatic merge from submit-queue Migrate some integration tests to run in dedicated namespace.
parents b37a5ded 925ba425
...@@ -44,7 +44,7 @@ import ( ...@@ -44,7 +44,7 @@ import (
) )
func TestClient(t *testing.T) { func TestClient(t *testing.T) {
_, s := framework.RunAMaster(t) _, s := framework.RunAMaster(nil)
defer s.Close() defer s.Close()
client := client.NewOrDie(&restclient.Config{Host: s.URL, ContentConfig: restclient.ContentConfig{GroupVersion: testapi.Default.GroupVersion()}}) client := client.NewOrDie(&restclient.Config{Host: s.URL, ContentConfig: restclient.ContentConfig{GroupVersion: testapi.Default.GroupVersion()}})
...@@ -116,7 +116,7 @@ func TestClient(t *testing.T) { ...@@ -116,7 +116,7 @@ func TestClient(t *testing.T) {
} }
func TestAtomicPut(t *testing.T) { func TestAtomicPut(t *testing.T) {
_, s := framework.RunAMaster(t) _, s := framework.RunAMaster(nil)
defer s.Close() defer s.Close()
c := client.NewOrDie(&restclient.Config{Host: s.URL, ContentConfig: restclient.ContentConfig{GroupVersion: testapi.Default.GroupVersion()}}) c := client.NewOrDie(&restclient.Config{Host: s.URL, ContentConfig: restclient.ContentConfig{GroupVersion: testapi.Default.GroupVersion()}})
...@@ -208,7 +208,7 @@ func TestAtomicPut(t *testing.T) { ...@@ -208,7 +208,7 @@ func TestAtomicPut(t *testing.T) {
} }
func TestPatch(t *testing.T) { func TestPatch(t *testing.T) {
_, s := framework.RunAMaster(t) _, s := framework.RunAMaster(nil)
defer s.Close() defer s.Close()
c := client.NewOrDie(&restclient.Config{Host: s.URL, ContentConfig: restclient.ContentConfig{GroupVersion: testapi.Default.GroupVersion()}}) c := client.NewOrDie(&restclient.Config{Host: s.URL, ContentConfig: restclient.ContentConfig{GroupVersion: testapi.Default.GroupVersion()}})
...@@ -317,7 +317,7 @@ func TestPatch(t *testing.T) { ...@@ -317,7 +317,7 @@ func TestPatch(t *testing.T) {
} }
func TestPatchWithCreateOnUpdate(t *testing.T) { func TestPatchWithCreateOnUpdate(t *testing.T) {
_, s := framework.RunAMaster(t) _, s := framework.RunAMaster(nil)
defer s.Close() defer s.Close()
c := client.NewOrDie(&restclient.Config{Host: s.URL, ContentConfig: restclient.ContentConfig{GroupVersion: testapi.Default.GroupVersion()}}) c := client.NewOrDie(&restclient.Config{Host: s.URL, ContentConfig: restclient.ContentConfig{GroupVersion: testapi.Default.GroupVersion()}})
...@@ -428,7 +428,7 @@ func TestPatchWithCreateOnUpdate(t *testing.T) { ...@@ -428,7 +428,7 @@ func TestPatchWithCreateOnUpdate(t *testing.T) {
} }
func TestAPIVersions(t *testing.T) { func TestAPIVersions(t *testing.T) {
_, s := framework.RunAMaster(t) _, s := framework.RunAMaster(nil)
defer s.Close() defer s.Close()
c := client.NewOrDie(&restclient.Config{Host: s.URL, ContentConfig: restclient.ContentConfig{GroupVersion: testapi.Default.GroupVersion()}}) c := client.NewOrDie(&restclient.Config{Host: s.URL, ContentConfig: restclient.ContentConfig{GroupVersion: testapi.Default.GroupVersion()}})
...@@ -450,7 +450,7 @@ func TestAPIVersions(t *testing.T) { ...@@ -450,7 +450,7 @@ func TestAPIVersions(t *testing.T) {
} }
func TestSingleWatch(t *testing.T) { func TestSingleWatch(t *testing.T) {
_, s := framework.RunAMaster(t) _, s := framework.RunAMaster(nil)
defer s.Close() defer s.Close()
ns := framework.CreateTestingNamespace("single-watch", s, t) ns := framework.CreateTestingNamespace("single-watch", s, t)
...@@ -535,7 +535,7 @@ func TestMultiWatch(t *testing.T) { ...@@ -535,7 +535,7 @@ func TestMultiWatch(t *testing.T) {
const watcherCount = 50 const watcherCount = 50
rt.GOMAXPROCS(watcherCount) rt.GOMAXPROCS(watcherCount)
_, s := framework.RunAMaster(t) _, s := framework.RunAMaster(nil)
defer s.Close() defer s.Close()
ns := framework.CreateTestingNamespace("multi-watch", s, t) ns := framework.CreateTestingNamespace("multi-watch", s, t)
...@@ -794,7 +794,7 @@ func TestSelfLinkOnNamespace(t *testing.T) { ...@@ -794,7 +794,7 @@ func TestSelfLinkOnNamespace(t *testing.T) {
// TODO: Limit the test to a single non-default namespace and clean this up at the end. // TODO: Limit the test to a single non-default namespace and clean this up at the end.
framework.DeleteAllEtcdKeys() framework.DeleteAllEtcdKeys()
_, s := framework.RunAMaster(t) _, s := framework.RunAMaster(nil)
defer s.Close() defer s.Close()
c := client.NewOrDie(&restclient.Config{Host: s.URL, ContentConfig: restclient.ContentConfig{GroupVersion: testapi.Default.GroupVersion()}}) c := client.NewOrDie(&restclient.Config{Host: s.URL, ContentConfig: restclient.ContentConfig{GroupVersion: testapi.Default.GroupVersion()}})
......
...@@ -32,7 +32,7 @@ import ( ...@@ -32,7 +32,7 @@ import (
// TestConfigMap tests apiserver-side behavior of creation of ConfigMaps and pods that consume them. // TestConfigMap tests apiserver-side behavior of creation of ConfigMaps and pods that consume them.
func TestConfigMap(t *testing.T) { func TestConfigMap(t *testing.T) {
_, s := framework.RunAMaster(t) _, s := framework.RunAMaster(nil)
defer s.Close() defer s.Close()
client := client.NewOrDie(&restclient.Config{Host: s.URL, ContentConfig: restclient.ContentConfig{GroupVersion: testapi.Default.GroupVersion()}}) client := client.NewOrDie(&restclient.Config{Host: s.URL, ContentConfig: restclient.ContentConfig{GroupVersion: testapi.Default.GroupVersion()}})
......
...@@ -34,12 +34,12 @@ import ( ...@@ -34,12 +34,12 @@ import (
) )
func TestDynamicClient(t *testing.T) { func TestDynamicClient(t *testing.T) {
// TODO: Limit the test to a single non-default namespace and clean this up at the end. _, s := framework.RunAMaster(nil)
framework.DeleteAllEtcdKeys()
_, s := framework.RunAMaster(t)
defer s.Close() defer s.Close()
ns := framework.CreateTestingNamespace("dynamic-client", s, t)
defer framework.DeleteTestingNamespace(ns, s, t)
gv := testapi.Default.GroupVersion() gv := testapi.Default.GroupVersion()
config := &restclient.Config{ config := &restclient.Config{
Host: s.URL, Host: s.URL,
...@@ -86,13 +86,13 @@ func TestDynamicClient(t *testing.T) { ...@@ -86,13 +86,13 @@ func TestDynamicClient(t *testing.T) {
}, },
} }
actual, err := client.Pods(framework.TestNS).Create(pod) actual, err := client.Pods(ns.Name).Create(pod)
if err != nil { if err != nil {
t.Fatalf("unexpected error when creating pod: %v", err) t.Fatalf("unexpected error when creating pod: %v", err)
} }
// check dynamic list // check dynamic list
unstructuredList, err := dynamicClient.Resource(&resource, framework.TestNS).List(&v1.ListOptions{}) unstructuredList, err := dynamicClient.Resource(&resource, ns.Name).List(&v1.ListOptions{})
if err != nil { if err != nil {
t.Fatalf("unexpected error when listing pods: %v", err) t.Fatalf("unexpected error when listing pods: %v", err)
} }
...@@ -111,7 +111,7 @@ func TestDynamicClient(t *testing.T) { ...@@ -111,7 +111,7 @@ func TestDynamicClient(t *testing.T) {
} }
// check dynamic get // check dynamic get
unstruct, err := dynamicClient.Resource(&resource, framework.TestNS).Get(actual.Name) unstruct, err := dynamicClient.Resource(&resource, ns.Name).Get(actual.Name)
if err != nil { if err != nil {
t.Fatalf("unexpected error when getting pod %q: %v", actual.Name, err) t.Fatalf("unexpected error when getting pod %q: %v", actual.Name, err)
} }
...@@ -126,12 +126,12 @@ func TestDynamicClient(t *testing.T) { ...@@ -126,12 +126,12 @@ func TestDynamicClient(t *testing.T) {
} }
// delete the pod dynamically // delete the pod dynamically
err = dynamicClient.Resource(&resource, framework.TestNS).Delete(actual.Name, nil) err = dynamicClient.Resource(&resource, ns.Name).Delete(actual.Name, nil)
if err != nil { if err != nil {
t.Fatalf("unexpected error when deleting pod: %v", err) t.Fatalf("unexpected error when deleting pod: %v", err)
} }
list, err := client.Pods(framework.TestNS).List(api.ListOptions{}) list, err := client.Pods(ns.Name).List(api.ListOptions{})
if err != nil { if err != nil {
t.Fatalf("unexpected error when listing pods: %v", err) t.Fatalf("unexpected error when listing pods: %v", err)
} }
......
...@@ -188,7 +188,7 @@ func TestSchedulerExtender(t *testing.T) { ...@@ -188,7 +188,7 @@ func TestSchedulerExtender(t *testing.T) {
// TODO: Limit the test to a single non-default namespace and clean this up at the end. // TODO: Limit the test to a single non-default namespace and clean this up at the end.
framework.DeleteAllEtcdKeys() framework.DeleteAllEtcdKeys()
_, s := framework.RunAMaster(t) _, s := framework.RunAMaster(nil)
defer s.Close() defer s.Close()
restClient := client.NewOrDie(&restclient.Config{Host: s.URL, ContentConfig: restclient.ContentConfig{GroupVersion: testapi.Default.GroupVersion()}}) restClient := client.NewOrDie(&restclient.Config{Host: s.URL, ContentConfig: restclient.ContentConfig{GroupVersion: testapi.Default.GroupVersion()}})
......
...@@ -51,6 +51,7 @@ import ( ...@@ -51,6 +51,7 @@ import (
"k8s.io/kubernetes/pkg/master" "k8s.io/kubernetes/pkg/master"
"k8s.io/kubernetes/pkg/runtime" "k8s.io/kubernetes/pkg/runtime"
"k8s.io/kubernetes/pkg/storage/storagebackend" "k8s.io/kubernetes/pkg/storage/storagebackend"
utilnet "k8s.io/kubernetes/pkg/util/net"
"k8s.io/kubernetes/plugin/pkg/admission/admit" "k8s.io/kubernetes/plugin/pkg/admission/admit"
"github.com/pborman/uuid" "github.com/pborman/uuid"
...@@ -152,6 +153,14 @@ func startMasterOrDie(masterConfig *master.Config) (*master.Master, *httptest.Se ...@@ -152,6 +153,14 @@ func startMasterOrDie(masterConfig *master.Config) (*master.Master, *httptest.Se
return m, s return m, s
} }
func parseCIDROrDie(cidr string) *net.IPNet {
_, parsed, err := net.ParseCIDR(cidr)
if err != nil {
glog.Fatalf("error while parsing CIDR: %s", cidr)
}
return parsed
}
// Returns a basic master config. // Returns a basic master config.
func NewMasterConfig() *master.Config { func NewMasterConfig() *master.Config {
config := storagebackend.Config{ config := storagebackend.Config{
...@@ -208,6 +217,9 @@ func NewMasterConfig() *master.Config { ...@@ -208,6 +217,9 @@ func NewMasterConfig() *master.Config {
AdmissionControl: admit.NewAlwaysAdmit(), AdmissionControl: admit.NewAlwaysAdmit(),
Serializer: api.Codecs, Serializer: api.Codecs,
EnableWatchCache: true, EnableWatchCache: true,
// Set those values to avoid annoying warnings in logs.
ServiceClusterIPRange: parseCIDROrDie("10.0.0.0/24"),
ServiceNodePortRange: utilnet.PortRange{Base: 30000, Size: 2768},
}, },
KubeletClient: kubeletclient.FakeKubeletClient{}, KubeletClient: kubeletclient.FakeKubeletClient{},
} }
...@@ -347,21 +359,12 @@ func StartPods(numPods int, host string, restClient *client.Client) error { ...@@ -347,21 +359,12 @@ func StartPods(numPods int, host string, restClient *client.Client) error {
} }
} }
// TODO: Merge this into startMasterOrDie. func RunAMaster(masterConfig *master.Config) (*master.Master, *httptest.Server) {
func RunAMaster(t *testing.T) (*master.Master, *httptest.Server) { if masterConfig == nil {
masterConfig := NewMasterConfig() masterConfig = NewMasterConfig()
masterConfig.EnableProfiling = true masterConfig.EnableProfiling = true
m, err := master.New(masterConfig)
if err != nil {
// TODO: Return error.
glog.Fatalf("error in bringing up the master: %v", err)
} }
return startMasterOrDie(masterConfig)
s := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, req *http.Request) {
m.Handler.ServeHTTP(w, req)
}))
return m, s
} }
// Task is a function passed to worker goroutines by RunParallel. // Task is a function passed to worker goroutines by RunParallel.
......
...@@ -42,7 +42,7 @@ import ( ...@@ -42,7 +42,7 @@ import (
) )
func testPrefix(t *testing.T, prefix string) { func testPrefix(t *testing.T, prefix string) {
_, s := framework.RunAMaster(t) _, s := framework.RunAMaster(nil)
defer s.Close() defer s.Close()
resp, err := http.Get(s.URL + prefix) resp, err := http.Get(s.URL + prefix)
...@@ -71,7 +71,7 @@ func TestExtensionsPrefix(t *testing.T) { ...@@ -71,7 +71,7 @@ func TestExtensionsPrefix(t *testing.T) {
} }
func TestWatchSucceedsWithoutArgs(t *testing.T) { func TestWatchSucceedsWithoutArgs(t *testing.T) {
_, s := framework.RunAMaster(t) _, s := framework.RunAMaster(nil)
defer s.Close() defer s.Close()
resp, err := http.Get(s.URL + "/api/v1/namespaces?watch=1") resp, err := http.Get(s.URL + "/api/v1/namespaces?watch=1")
...@@ -118,7 +118,7 @@ func extensionsPath(resource, namespace, name string) string { ...@@ -118,7 +118,7 @@ func extensionsPath(resource, namespace, name string) string {
} }
func TestAutoscalingGroupBackwardCompatibility(t *testing.T) { func TestAutoscalingGroupBackwardCompatibility(t *testing.T) {
_, s := framework.RunAMaster(t) _, s := framework.RunAMaster(nil)
defer s.Close() defer s.Close()
transport := http.DefaultTransport transport := http.DefaultTransport
...@@ -261,7 +261,7 @@ func TestBatchGroupBackwardCompatibility(t *testing.T) { ...@@ -261,7 +261,7 @@ func TestBatchGroupBackwardCompatibility(t *testing.T) {
if *testapi.Batch.GroupVersion() == v2alpha1.SchemeGroupVersion { if *testapi.Batch.GroupVersion() == v2alpha1.SchemeGroupVersion {
t.Skip("Shared job storage is not required for batch/v2alpha1.") t.Skip("Shared job storage is not required for batch/v2alpha1.")
} }
_, s := framework.RunAMaster(t) _, s := framework.RunAMaster(nil)
defer s.Close() defer s.Close()
transport := http.DefaultTransport transport := http.DefaultTransport
...@@ -314,7 +314,7 @@ func TestBatchGroupBackwardCompatibility(t *testing.T) { ...@@ -314,7 +314,7 @@ func TestBatchGroupBackwardCompatibility(t *testing.T) {
} }
func TestAccept(t *testing.T) { func TestAccept(t *testing.T) {
_, s := framework.RunAMaster(t) _, s := framework.RunAMaster(nil)
defer s.Close() defer s.Close()
resp, err := http.Get(s.URL + "/api/") resp, err := http.Get(s.URL + "/api/")
......
...@@ -86,7 +86,7 @@ func checkForExpectedMetrics(t *testing.T, metrics []*prometheuspb.MetricFamily, ...@@ -86,7 +86,7 @@ func checkForExpectedMetrics(t *testing.T, metrics []*prometheuspb.MetricFamily,
} }
func TestMasterProcessMetrics(t *testing.T) { func TestMasterProcessMetrics(t *testing.T) {
_, s := framework.RunAMaster(t) _, s := framework.RunAMaster(nil)
defer s.Close() defer s.Close()
metrics, err := scrapeMetrics(s) metrics, err := scrapeMetrics(s)
...@@ -103,7 +103,7 @@ func TestMasterProcessMetrics(t *testing.T) { ...@@ -103,7 +103,7 @@ func TestMasterProcessMetrics(t *testing.T) {
} }
func TestApiserverMetrics(t *testing.T) { func TestApiserverMetrics(t *testing.T) {
_, s := framework.RunAMaster(t) _, s := framework.RunAMaster(nil)
defer s.Close() defer s.Close()
// Make a request to the apiserver to ensure there's at least one data point // Make a request to the apiserver to ensure there's at least one data point
......
...@@ -108,7 +108,7 @@ func TestPersistentVolumeRecycler(t *testing.T) { ...@@ -108,7 +108,7 @@ func TestPersistentVolumeRecycler(t *testing.T) {
framework.DeleteAllEtcdKeys() framework.DeleteAllEtcdKeys()
glog.V(2).Infof("TestPersistentVolumeRecycler started") glog.V(2).Infof("TestPersistentVolumeRecycler started")
_, s := framework.RunAMaster(t) _, s := framework.RunAMaster(nil)
defer s.Close() defer s.Close()
testClient, ctrl, watchPV, watchPVC := createClients(t, s) testClient, ctrl, watchPV, watchPVC := createClients(t, s)
...@@ -158,7 +158,7 @@ func TestPersistentVolumeDeleter(t *testing.T) { ...@@ -158,7 +158,7 @@ func TestPersistentVolumeDeleter(t *testing.T) {
framework.DeleteAllEtcdKeys() framework.DeleteAllEtcdKeys()
glog.V(2).Infof("TestPersistentVolumeDeleter started") glog.V(2).Infof("TestPersistentVolumeDeleter started")
_, s := framework.RunAMaster(t) _, s := framework.RunAMaster(nil)
defer s.Close() defer s.Close()
testClient, ctrl, watchPV, watchPVC := createClients(t, s) testClient, ctrl, watchPV, watchPVC := createClients(t, s)
...@@ -212,7 +212,7 @@ func TestPersistentVolumeBindRace(t *testing.T) { ...@@ -212,7 +212,7 @@ func TestPersistentVolumeBindRace(t *testing.T) {
// Test a race binding many claims to a PV that is pre-bound to a specific // Test a race binding many claims to a PV that is pre-bound to a specific
// PVC. Only this specific PVC should get bound. // PVC. Only this specific PVC should get bound.
glog.V(2).Infof("TestPersistentVolumeBindRace started") glog.V(2).Infof("TestPersistentVolumeBindRace started")
_, s := framework.RunAMaster(t) _, s := framework.RunAMaster(nil)
defer s.Close() defer s.Close()
testClient, ctrl, watchPV, watchPVC := createClients(t, s) testClient, ctrl, watchPV, watchPVC := createClients(t, s)
...@@ -279,7 +279,7 @@ func TestPersistentVolumeClaimLabelSelector(t *testing.T) { ...@@ -279,7 +279,7 @@ func TestPersistentVolumeClaimLabelSelector(t *testing.T) {
// TODO: Limit the test to a single non-default namespace and clean this up at the end. // TODO: Limit the test to a single non-default namespace and clean this up at the end.
framework.DeleteAllEtcdKeys() framework.DeleteAllEtcdKeys()
_, s := framework.RunAMaster(t) _, s := framework.RunAMaster(nil)
defer s.Close() defer s.Close()
testClient, controller, watchPV, watchPVC := createClients(t, s) testClient, controller, watchPV, watchPVC := createClients(t, s)
...@@ -354,7 +354,7 @@ func TestPersistentVolumeClaimLabelSelectorMatchExpressions(t *testing.T) { ...@@ -354,7 +354,7 @@ func TestPersistentVolumeClaimLabelSelectorMatchExpressions(t *testing.T) {
// TODO: Limit the test to a single non-default namespace and clean this up at the end. // TODO: Limit the test to a single non-default namespace and clean this up at the end.
framework.DeleteAllEtcdKeys() framework.DeleteAllEtcdKeys()
_, s := framework.RunAMaster(t) _, s := framework.RunAMaster(nil)
defer s.Close() defer s.Close()
testClient, controller, watchPV, watchPVC := createClients(t, s) testClient, controller, watchPV, watchPVC := createClients(t, s)
...@@ -448,7 +448,7 @@ func TestPersistentVolumeMultiPVs(t *testing.T) { ...@@ -448,7 +448,7 @@ func TestPersistentVolumeMultiPVs(t *testing.T) {
// TODO: Limit the test to a single non-default namespace and clean this up at the end. // TODO: Limit the test to a single non-default namespace and clean this up at the end.
framework.DeleteAllEtcdKeys() framework.DeleteAllEtcdKeys()
_, s := framework.RunAMaster(t) _, s := framework.RunAMaster(nil)
defer s.Close() defer s.Close()
testClient, controller, watchPV, watchPVC := createClients(t, s) testClient, controller, watchPV, watchPVC := createClients(t, s)
...@@ -532,7 +532,7 @@ func TestPersistentVolumeMultiPVsPVCs(t *testing.T) { ...@@ -532,7 +532,7 @@ func TestPersistentVolumeMultiPVsPVCs(t *testing.T) {
// TODO: Limit the test to a single non-default namespace and clean this up at the end. // TODO: Limit the test to a single non-default namespace and clean this up at the end.
framework.DeleteAllEtcdKeys() framework.DeleteAllEtcdKeys()
_, s := framework.RunAMaster(t) _, s := framework.RunAMaster(nil)
defer s.Close() defer s.Close()
testClient, binder, watchPV, watchPVC := createClients(t, s) testClient, binder, watchPV, watchPVC := createClients(t, s)
...@@ -613,7 +613,7 @@ func TestPersistentVolumeProvisionMultiPVCs(t *testing.T) { ...@@ -613,7 +613,7 @@ func TestPersistentVolumeProvisionMultiPVCs(t *testing.T) {
// TODO: Limit the test to a single non-default namespace and clean this up at the end. // TODO: Limit the test to a single non-default namespace and clean this up at the end.
framework.DeleteAllEtcdKeys() framework.DeleteAllEtcdKeys()
_, s := framework.RunAMaster(t) _, s := framework.RunAMaster(nil)
defer s.Close() defer s.Close()
testClient, binder, watchPV, watchPVC := createClients(t, s) testClient, binder, watchPV, watchPVC := createClients(t, s)
...@@ -692,7 +692,7 @@ func TestPersistentVolumeMultiPVsDiffAccessModes(t *testing.T) { ...@@ -692,7 +692,7 @@ func TestPersistentVolumeMultiPVsDiffAccessModes(t *testing.T) {
// TODO: Limit the test to a single non-default namespace and clean this up at the end. // TODO: Limit the test to a single non-default namespace and clean this up at the end.
framework.DeleteAllEtcdKeys() framework.DeleteAllEtcdKeys()
_, s := framework.RunAMaster(t) _, s := framework.RunAMaster(nil)
defer s.Close() defer s.Close()
testClient, controller, watchPV, watchPVC := createClients(t, s) testClient, controller, watchPV, watchPVC := createClients(t, s)
......
...@@ -30,7 +30,7 @@ import ( ...@@ -30,7 +30,7 @@ import (
) )
func TestPodUpdateActiveDeadlineSeconds(t *testing.T) { func TestPodUpdateActiveDeadlineSeconds(t *testing.T) {
_, s := framework.RunAMaster(t) _, s := framework.RunAMaster(nil)
defer s.Close() defer s.Close()
ns := framework.CreateTestingNamespace("pod-activedeadline-update", s, t) ns := framework.CreateTestingNamespace("pod-activedeadline-update", s, t)
...@@ -147,7 +147,7 @@ func TestPodUpdateActiveDeadlineSeconds(t *testing.T) { ...@@ -147,7 +147,7 @@ func TestPodUpdateActiveDeadlineSeconds(t *testing.T) {
} }
func TestPodReadOnlyFilesystem(t *testing.T) { func TestPodReadOnlyFilesystem(t *testing.T) {
_, s := framework.RunAMaster(t) _, s := framework.RunAMaster(nil)
defer s.Close() defer s.Close()
isReadOnly := true isReadOnly := true
......
...@@ -64,8 +64,7 @@ func TestQuota(t *testing.T) { ...@@ -64,8 +64,7 @@ func TestQuota(t *testing.T) {
<-initializationCh <-initializationCh
m.Handler.ServeHTTP(w, req) m.Handler.ServeHTTP(w, req)
})) }))
// TODO: https://github.com/kubernetes/kubernetes/issues/25412 defer s.Close()
//defer s.Close()
admissionCh := make(chan struct{}) admissionCh := make(chan struct{})
clientset := clientset.NewForConfigOrDie(&restclient.Config{QPS: -1, Host: s.URL, ContentConfig: restclient.ContentConfig{GroupVersion: testapi.Default.GroupVersion()}}) clientset := clientset.NewForConfigOrDie(&restclient.Config{QPS: -1, Host: s.URL, ContentConfig: restclient.ContentConfig{GroupVersion: testapi.Default.GroupVersion()}})
admission, err := resourcequota.NewResourceQuota(clientset, quotainstall.NewRegistry(clientset), 5, admissionCh) admission, err := resourcequota.NewResourceQuota(clientset, quotainstall.NewRegistry(clientset), 5, admissionCh)
......
...@@ -53,7 +53,7 @@ func TestUnschedulableNodes(t *testing.T) { ...@@ -53,7 +53,7 @@ func TestUnschedulableNodes(t *testing.T) {
// TODO: Limit the test to a single non-default namespace and clean this up at the end. // TODO: Limit the test to a single non-default namespace and clean this up at the end.
framework.DeleteAllEtcdKeys() framework.DeleteAllEtcdKeys()
_, s := framework.RunAMaster(t) _, s := framework.RunAMaster(nil)
defer s.Close() defer s.Close()
restClient := client.NewOrDie(&restclient.Config{Host: s.URL, ContentConfig: restclient.ContentConfig{GroupVersion: testapi.Default.GroupVersion()}}) restClient := client.NewOrDie(&restclient.Config{Host: s.URL, ContentConfig: restclient.ContentConfig{GroupVersion: testapi.Default.GroupVersion()}})
...@@ -292,7 +292,7 @@ func TestMultiScheduler(t *testing.T) { ...@@ -292,7 +292,7 @@ func TestMultiScheduler(t *testing.T) {
// TODO: Limit the test to a single non-default namespace and clean this up at the end. // TODO: Limit the test to a single non-default namespace and clean this up at the end.
framework.DeleteAllEtcdKeys() framework.DeleteAllEtcdKeys()
_, s := framework.RunAMaster(t) _, s := framework.RunAMaster(nil)
// TODO: Uncomment when fix #19254 // TODO: Uncomment when fix #19254
// This seems to be a different issue - it still doesn't work. // This seems to be a different issue - it still doesn't work.
// defer s.Close() // defer s.Close()
...@@ -473,7 +473,7 @@ func createPod(client *client.Client, name string, annotation map[string]string) ...@@ -473,7 +473,7 @@ func createPod(client *client.Client, name string, annotation map[string]string)
func TestAllocatable(t *testing.T) { func TestAllocatable(t *testing.T) {
framework.DeleteAllEtcdKeys() framework.DeleteAllEtcdKeys()
_, s := framework.RunAMaster(t) _, s := framework.RunAMaster(nil)
defer s.Close() defer s.Close()
// 1. create and start default-scheduler // 1. create and start default-scheduler
......
...@@ -38,7 +38,7 @@ func deleteSecretOrErrorf(t *testing.T, c *client.Client, ns, name string) { ...@@ -38,7 +38,7 @@ func deleteSecretOrErrorf(t *testing.T, c *client.Client, ns, name string) {
// TestSecrets tests apiserver-side behavior of creation of secret objects and their use by pods. // TestSecrets tests apiserver-side behavior of creation of secret objects and their use by pods.
func TestSecrets(t *testing.T) { func TestSecrets(t *testing.T) {
_, s := framework.RunAMaster(t) _, s := framework.RunAMaster(nil)
defer s.Close() defer s.Close()
client := client.NewOrDie(&restclient.Config{Host: s.URL, ContentConfig: restclient.ContentConfig{GroupVersion: testapi.Default.GroupVersion()}}) client := client.NewOrDie(&restclient.Config{Host: s.URL, ContentConfig: restclient.ContentConfig{GroupVersion: testapi.Default.GroupVersion()}})
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment