Comment out calls to httptest.Server.Close() to work around

https://github.com/golang/go/issues/12262 . See #19254 for
more details. This change should be reverted when we upgrade
to Go 1.6.
This commit is contained in:
David Oppenheimer
2016-01-10 14:39:32 -08:00
parent 6f50699b93
commit 8ac484793d
50 changed files with 410 additions and 202 deletions

View File

@@ -102,7 +102,8 @@ func TestSyncEndpointsItemsPreserveNoSelector(t *testing.T) {
Ports: []api.EndpointPort{{Port: 1000}},
}},
}})
defer testServer.Close()
// TODO: Uncomment when fix #19254
// defer testServer.Close()
client := client.NewOrDie(&client.Config{Host: testServer.URL, GroupVersion: testapi.Default.GroupVersion()})
endpoints := NewEndpointController(client, controller.NoResyncPeriodFunc)
endpoints.serviceStore.Store.Add(&api.Service{
@@ -134,7 +135,8 @@ func TestCheckLeftoverEndpoints(t *testing.T) {
}},
}},
}})
defer testServer.Close()
// TODO: Uncomment when fix #19254
// defer testServer.Close()
client := client.NewOrDie(&client.Config{Host: testServer.URL, GroupVersion: testapi.Default.GroupVersion()})
endpoints := NewEndpointController(client, controller.NoResyncPeriodFunc)
endpoints.checkLeftoverEndpoints()
@@ -162,7 +164,8 @@ func TestSyncEndpointsProtocolTCP(t *testing.T) {
Ports: []api.EndpointPort{{Port: 1000, Protocol: "TCP"}},
}},
}})
defer testServer.Close()
// TODO: Uncomment when fix #19254
// defer testServer.Close()
client := client.NewOrDie(&client.Config{Host: testServer.URL, GroupVersion: testapi.Default.GroupVersion()})
endpoints := NewEndpointController(client, controller.NoResyncPeriodFunc)
endpoints.serviceStore.Store.Add(&api.Service{
@@ -190,7 +193,8 @@ func TestSyncEndpointsProtocolUDP(t *testing.T) {
Ports: []api.EndpointPort{{Port: 1000, Protocol: "UDP"}},
}},
}})
defer testServer.Close()
// TODO: Uncomment when fix #19254
// defer testServer.Close()
client := client.NewOrDie(&client.Config{Host: testServer.URL, GroupVersion: testapi.Default.GroupVersion()})
endpoints := NewEndpointController(client, controller.NoResyncPeriodFunc)
endpoints.serviceStore.Store.Add(&api.Service{
@@ -215,7 +219,8 @@ func TestSyncEndpointsItemsEmptySelectorSelectsAll(t *testing.T) {
},
Subsets: []api.EndpointSubset{},
}})
defer testServer.Close()
// TODO: Uncomment when fix #19254
// defer testServer.Close()
client := client.NewOrDie(&client.Config{Host: testServer.URL, GroupVersion: testapi.Default.GroupVersion()})
endpoints := NewEndpointController(client, controller.NoResyncPeriodFunc)
addPods(endpoints.podStore.Store, ns, 1, 1, 0)
@@ -252,7 +257,8 @@ func TestSyncEndpointsItemsEmptySelectorSelectsAllNotReady(t *testing.T) {
},
Subsets: []api.EndpointSubset{},
}})
defer testServer.Close()
// TODO: Uncomment when fix #19254
// defer testServer.Close()
client := client.NewOrDie(&client.Config{Host: testServer.URL, GroupVersion: testapi.Default.GroupVersion()})
endpoints := NewEndpointController(client, controller.NoResyncPeriodFunc)
addPods(endpoints.podStore.Store, ns, 0, 1, 1)
@@ -289,7 +295,8 @@ func TestSyncEndpointsItemsEmptySelectorSelectsAllMixed(t *testing.T) {
},
Subsets: []api.EndpointSubset{},
}})
defer testServer.Close()
// TODO: Uncomment when fix #19254
// defer testServer.Close()
client := client.NewOrDie(&client.Config{Host: testServer.URL, GroupVersion: testapi.Default.GroupVersion()})
endpoints := NewEndpointController(client, controller.NoResyncPeriodFunc)
addPods(endpoints.podStore.Store, ns, 1, 1, 1)
@@ -330,7 +337,8 @@ func TestSyncEndpointsItemsPreexisting(t *testing.T) {
Ports: []api.EndpointPort{{Port: 1000}},
}},
}})
defer testServer.Close()
// TODO: Uncomment when fix #19254
// defer testServer.Close()
client := client.NewOrDie(&client.Config{Host: testServer.URL, GroupVersion: testapi.Default.GroupVersion()})
endpoints := NewEndpointController(client, controller.NoResyncPeriodFunc)
addPods(endpoints.podStore.Store, ns, 1, 1, 0)
@@ -370,7 +378,8 @@ func TestSyncEndpointsItemsPreexistingIdentical(t *testing.T) {
Ports: []api.EndpointPort{{Port: 8080, Protocol: "TCP"}},
}},
}})
defer testServer.Close()
// TODO: Uncomment when fix #19254
// defer testServer.Close()
client := client.NewOrDie(&client.Config{Host: testServer.URL, GroupVersion: testapi.Default.GroupVersion()})
endpoints := NewEndpointController(client, controller.NoResyncPeriodFunc)
addPods(endpoints.podStore.Store, api.NamespaceDefault, 1, 1, 0)
@@ -389,7 +398,8 @@ func TestSyncEndpointsItems(t *testing.T) {
ns := "other"
testServer, endpointsHandler := makeTestServer(t, ns,
serverResponse{http.StatusOK, &api.Endpoints{}})
defer testServer.Close()
// TODO: Uncomment when fix #19254
// defer testServer.Close()
client := client.NewOrDie(&client.Config{Host: testServer.URL, GroupVersion: testapi.Default.GroupVersion()})
endpoints := NewEndpointController(client, controller.NoResyncPeriodFunc)
addPods(endpoints.podStore.Store, ns, 3, 2, 0)
@@ -431,7 +441,8 @@ func TestSyncEndpointsItemsWithLabels(t *testing.T) {
ns := "other"
testServer, endpointsHandler := makeTestServer(t, ns,
serverResponse{http.StatusOK, &api.Endpoints{}})
defer testServer.Close()
// TODO: Uncomment when fix #19254
// defer testServer.Close()
client := client.NewOrDie(&client.Config{Host: testServer.URL, GroupVersion: testapi.Default.GroupVersion()})
endpoints := NewEndpointController(client, controller.NoResyncPeriodFunc)
addPods(endpoints.podStore.Store, ns, 3, 2, 0)
@@ -491,7 +502,8 @@ func TestSyncEndpointsItemsPreexistingLabelsChange(t *testing.T) {
Ports: []api.EndpointPort{{Port: 1000}},
}},
}})
defer testServer.Close()
// TODO: Uncomment when fix #19254
// defer testServer.Close()
client := client.NewOrDie(&client.Config{Host: testServer.URL, GroupVersion: testapi.Default.GroupVersion()})
endpoints := NewEndpointController(client, controller.NoResyncPeriodFunc)
addPods(endpoints.podStore.Store, ns, 1, 1, 0)