Make timeout for starting system pods configurable

This commit is contained in:
Wojciech Tyczynski 2016-06-15 08:37:01 +02:00
parent 922facd652
commit e0498ed76a
3 changed files with 28 additions and 27 deletions

View File

@ -446,6 +446,7 @@ suicide-timeout
sync-frequency sync-frequency
system-cgroups system-cgroups
system-container system-container
system-pods-startup-timeout
system-reserved system-reserved
target-port target-port
tcp-services tcp-services

View File

@ -40,11 +40,6 @@ import (
) )
const ( const (
// podStartupTimeout is the time to allow all pods in the cluster to become
// running and ready before any e2e tests run. It includes pulling all of
// the pods (as of 5/18/15 this is 8 pods).
podStartupTimeout = 10 * time.Minute
// imagePrePullingTimeout is the time we wait for the e2e-image-puller // imagePrePullingTimeout is the time we wait for the e2e-image-puller
// static pods to pull the list of seeded images. If they don't pull // static pods to pull the list of seeded images. If they don't pull
// images within this time we simply log their output and carry on // images within this time we simply log their output and carry on
@ -129,6 +124,7 @@ var _ = ginkgo.SynchronizedBeforeSuite(func() []byte {
// cluster infrastructure pods that are being pulled or started can block // cluster infrastructure pods that are being pulled or started can block
// test pods from running, and tests that ensure all pods are running and // test pods from running, and tests that ensure all pods are running and
// ready will fail). // ready will fail).
podStartupTimeout := framework.TestContext.SystemPodsStartupTimeout
if err := framework.WaitForPodsRunningReady(c, api.NamespaceSystem, int32(framework.TestContext.MinStartupPods), podStartupTimeout, framework.ImagePullerLabels); err != nil { if err := framework.WaitForPodsRunningReady(c, api.NamespaceSystem, int32(framework.TestContext.MinStartupPods), podStartupTimeout, framework.ImagePullerLabels); err != nil {
framework.DumpAllNamespaceInfo(c, api.NamespaceSystem) framework.DumpAllNamespaceInfo(c, api.NamespaceSystem)
framework.LogFailedContainers(c, api.NamespaceSystem) framework.LogFailedContainers(c, api.NamespaceSystem)
@ -141,7 +137,7 @@ var _ = ginkgo.SynchronizedBeforeSuite(func() []byte {
// and we don't even run the image puller on all platforms (including GKE). // and we don't even run the image puller on all platforms (including GKE).
// We wait for it so we get an indication of failures in the logs, and to // We wait for it so we get an indication of failures in the logs, and to
// maximize benefit of image pre-pulling. // maximize benefit of image pre-pulling.
framework.Logf("WARNING: Image pulling pods failed to enter success in %v: %v", podStartupTimeout, err) framework.Logf("WARNING: Image pulling pods failed to enter success in %v: %v", imagePrePullingTimeout, err)
} }
return nil return nil

View File

@ -19,6 +19,7 @@ package framework
import ( import (
"flag" "flag"
"os" "os"
"time"
"github.com/onsi/ginkgo/config" "github.com/onsi/ginkgo/config"
"k8s.io/kubernetes/pkg/client/unversioned/clientcmd" "k8s.io/kubernetes/pkg/client/unversioned/clientcmd"
@ -26,27 +27,29 @@ import (
) )
type TestContextType struct { type TestContextType struct {
KubeConfig string KubeConfig string
KubeContext string KubeContext string
KubeAPIContentType string KubeAPIContentType string
KubeVolumeDir string KubeVolumeDir string
CertDir string CertDir string
Host string Host string
RepoRoot string RepoRoot string
Provider string Provider string
CloudConfig CloudConfig CloudConfig CloudConfig
KubectlPath string KubectlPath string
OutputDir string OutputDir string
ReportDir string ReportDir string
ReportPrefix string ReportPrefix string
Prefix string Prefix string
MinStartupPods int MinStartupPods int
UpgradeTarget string // Timeout for waiting for system pods to be running
PrometheusPushGateway string SystemPodsStartupTimeout time.Duration
OSDistro string UpgradeTarget string
VerifyServiceAccount bool PrometheusPushGateway string
DeleteNamespace bool OSDistro string
CleanStart bool VerifyServiceAccount bool
DeleteNamespace bool
CleanStart bool
// If set to 'true' or 'all' framework will start a goroutine monitoring resource usage of system add-ons. // If set to 'true' or 'all' framework will start a goroutine monitoring resource usage of system add-ons.
// It will read the data every 30 seconds from all Nodes and print summary during afterEach. If set to 'master' // It will read the data every 30 seconds from all Nodes and print summary during afterEach. If set to 'master'
// only master Node will be monitored. // only master Node will be monitored.
@ -118,6 +121,7 @@ func RegisterFlags() {
flag.StringVar(&cloudConfig.ClusterTag, "cluster-tag", "", "Tag used to identify resources. Only required if provider is aws.") flag.StringVar(&cloudConfig.ClusterTag, "cluster-tag", "", "Tag used to identify resources. Only required if provider is aws.")
flag.IntVar(&TestContext.MinStartupPods, "minStartupPods", 0, "The number of pods which we need to see in 'Running' state with a 'Ready' condition of true, before we try running tests. This is useful in any cluster which needs some base pod-based services running before it can be used.") flag.IntVar(&TestContext.MinStartupPods, "minStartupPods", 0, "The number of pods which we need to see in 'Running' state with a 'Ready' condition of true, before we try running tests. This is useful in any cluster which needs some base pod-based services running before it can be used.")
flag.DurationVar(&TestContext.SystemPodsStartupTimeout, "system-pods-startup-timeout", 10*time.Minute, "Timeout for waiting for all system pods to be running before starting tests.")
flag.StringVar(&TestContext.UpgradeTarget, "upgrade-target", "ci/latest", "Version to upgrade to (e.g. 'release/stable', 'release/latest', 'ci/latest', '0.19.1', '0.19.1-669-gabac8c8') if doing an upgrade test.") flag.StringVar(&TestContext.UpgradeTarget, "upgrade-target", "ci/latest", "Version to upgrade to (e.g. 'release/stable', 'release/latest', 'ci/latest', '0.19.1', '0.19.1-669-gabac8c8') if doing an upgrade test.")
flag.StringVar(&TestContext.PrometheusPushGateway, "prom-push-gateway", "", "The URL to prometheus gateway, so that metrics can be pushed during e2es and scraped by prometheus. Typically something like 127.0.0.1:9091.") flag.StringVar(&TestContext.PrometheusPushGateway, "prom-push-gateway", "", "The URL to prometheus gateway, so that metrics can be pushed during e2es and scraped by prometheus. Typically something like 127.0.0.1:9091.")
flag.BoolVar(&TestContext.VerifyServiceAccount, "e2e-verify-service-account", true, "If true tests will verify the service account before running.") flag.BoolVar(&TestContext.VerifyServiceAccount, "e2e-verify-service-account", true, "If true tests will verify the service account before running.")