Merge pull request #35114 from wojtek-t/speedup_networking_tests

Automatic merge from submit-queue

Speed up some networking tests in large clusters

Since we are getting towards testing larger and larger clusters (hopefully 5000-node ones soon-ish), I'm trying to limit the amount of super long tests to minimum.

This should significantly reduce amount of time used by those from test/e2e/networking.go.

@gmarek
This commit is contained in:
Kubernetes Submit Queue
2016-10-26 10:23:20 -07:00
committed by GitHub

View File

@@ -52,7 +52,7 @@ const (
// because we verify iptables statistical rr loadbalancing.
testTries = 30
// Maximum number of pods in a test, to make test work in large clusters.
maxNetProxyPodsCount = 20
maxNetProxyPodsCount = 10
)
// NewNetworkingTestConfig creates and sets up a new test config helper.
@@ -219,7 +219,9 @@ func (config *NetworkingTestConfig) DialFromContainer(protocol, containerIP, tar
func (config *NetworkingTestConfig) DialFromNode(protocol, targetIP string, targetPort, maxTries, minTries int, expectedEps sets.String) {
var cmd string
if protocol == "udp" {
cmd = fmt.Sprintf("echo 'hostName' | timeout -t 3 nc -w 1 -u %s %d", targetIP, targetPort)
// TODO: It would be enough to pass 1s+epsilon to timeout, but unfortunately
// busybox timeout doesn't support non-integer values.
cmd = fmt.Sprintf("echo 'hostName' | timeout -t 2 nc -w 1 -u %s %d", targetIP, targetPort)
} else {
cmd = fmt.Sprintf("curl -q -s --connect-timeout 1 http://%s:%d/hostName", targetIP, targetPort)
}
@@ -486,8 +488,8 @@ func (config *NetworkingTestConfig) createNetProxyPods(podName string, selector
nodeList := GetReadySchedulableNodesOrDie(config.f.ClientSet)
// To make this test work reasonably fast in large clusters,
// we limit the number of NetProxyPods to no more than 100 ones
// on random nodes.
// we limit the number of NetProxyPods to no more than
// maxNetProxyPodsCount on random nodes.
nodes := shuffleNodes(nodeList.Items)
if len(nodes) > maxNetProxyPodsCount {
nodes = nodes[:maxNetProxyPodsCount]