diff --git a/test/e2e/scalability/BUILD b/test/e2e/scalability/BUILD index a87ebd8c347..0d7e0e47f69 100644 --- a/test/e2e/scalability/BUILD +++ b/test/e2e/scalability/BUILD @@ -3,6 +3,7 @@ load("@io_bazel_rules_go//go:def.bzl", "go_library") go_library( name = "go_default_library", srcs = [ + "common.go", "density.go", "framework.go", "load.go", diff --git a/test/e2e/scalability/common.go b/test/e2e/scalability/common.go new file mode 100644 index 00000000000..4fac86cb03d --- /dev/null +++ b/test/e2e/scalability/common.go @@ -0,0 +1,24 @@ +/* +Copyright 2018 The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package scalability + +import "time" + +const ( + // UnreadyNodeToleration denotes time the node can be unreachable/not ready. + UnreadyNodeToleration = 15 * time.Minute +) diff --git a/test/e2e/scalability/density.go b/test/e2e/scalability/density.go index 3d4d9a6e21e..9a2e64256c3 100644 --- a/test/e2e/scalability/density.go +++ b/test/e2e/scalability/density.go @@ -637,7 +637,11 @@ var _ = SIGDescribe("Density", func() { // Since all RCs are created at the same time, timeout for each config // has to assume that it will be run at the very end. podThroughput := 20 - timeout := time.Duration(totalPods/podThroughput)*time.Second + 3*time.Minute + timeout := time.Duration(totalPods/podThroughput) * time.Second + if timeout < UnreadyNodeToleration { + timeout = UnreadyNodeToleration + } + timeout += 3 * time.Minute // createClients is defined in load.go clients, internalClients, scalesClients, err := createClients(numberOfCollections) framework.ExpectNoError(err) @@ -688,6 +692,19 @@ var _ = SIGDescribe("Density", func() { SecretNames: secretNames, ConfigMapNames: configMapNames, ServiceAccountTokenProjections: itArg.svcacctTokenProjectionsPerPod, + Tolerations: []v1.Toleration{ + { + Key: "node.kubernetes.io/not-ready", + Operator: v1.TolerationOpExists, + Effect: v1.TaintEffectNoExecute, + TolerationSeconds: func(i int64) *int64 { return &i }(int64(UnreadyNodeToleration / time.Second)), + }, { + Key: "node.kubernetes.io/unreachable", + Operator: v1.TolerationOpExists, + Effect: v1.TaintEffectNoExecute, + TolerationSeconds: func(i int64) *int64 { return &i }(int64(UnreadyNodeToleration / time.Second)), + }, + }, } switch itArg.kind { case api.Kind("ReplicationController"): diff --git a/test/e2e/scalability/load.go b/test/e2e/scalability/load.go index 78d3d45c55c..5e2a95e2d9c 100644 --- a/test/e2e/scalability/load.go +++ b/test/e2e/scalability/load.go @@ -541,7 +541,7 @@ func GenerateConfigsForGroup( InternalClient: nil, // this will be overwritten later Name: groupName + "-" + strconv.Itoa(i), Namespace: namespace, - Timeout: 10 * time.Minute, + Timeout: UnreadyNodeToleration, Image: image, Command: command, Replicas: size, @@ -551,6 +551,19 @@ func GenerateConfigsForGroup( ConfigMapNames: configMapNames, // Define a label to group every 2 RCs into one service. Labels: map[string]string{svcLabelKey: groupName + "-" + strconv.Itoa((i+1)/2)}, + Tolerations: []v1.Toleration{ + { + Key: "node.kubernetes.io/not-ready", + Operator: v1.TolerationOpExists, + Effect: v1.TaintEffectNoExecute, + TolerationSeconds: func(i int64) *int64 { return &i }(int64(UnreadyNodeToleration / time.Second)), + }, { + Key: "node.kubernetes.io/unreachable", + Operator: v1.TolerationOpExists, + Effect: v1.TaintEffectNoExecute, + TolerationSeconds: func(i int64) *int64 { return &i }(int64(UnreadyNodeToleration / time.Second)), + }, + }, } if kind == randomKind {