diff --git a/hack/jenkins/e2e.sh b/hack/jenkins/e2e.sh index f52b6b2e279..f381e0935fe 100755 --- a/hack/jenkins/e2e.sh +++ b/hack/jenkins/e2e.sh @@ -432,7 +432,8 @@ case ${JOB_NAME} in kubernetes-e2e-gce-scalability) : ${E2E_CLUSTER_NAME:="jenkins-gce-e2e-scalability"} : ${E2E_NETWORK:="e2e-scalability"} - : ${GINKGO_TEST_ARGS:="--ginkgo.focus=\[Performance\]"} + : ${GINKGO_TEST_ARGS:="--ginkgo.focus=\[Performance\] \ + --gather-resource-usage=true"} : ${KUBE_GCE_INSTANCE_PREFIX:="e2e-scalability"} : ${PROJECT:="kubernetes-jenkins"} # Override GCE defaults. diff --git a/test/e2e/density.go b/test/e2e/density.go index 74d2444f107..3c7b1205dde 100644 --- a/test/e2e/density.go +++ b/test/e2e/density.go @@ -82,6 +82,9 @@ var _ = Describe("Density [Skipped]", func() { var ns string var uuid string + framework := NewFramework("density") + framework.NamespaceDeletionTimeout = time.Hour + // Gathers data prior to framework namespace teardown AfterEach(func() { // Remove any remaining pods from this test if the @@ -115,10 +118,6 @@ var _ = Describe("Density [Skipped]", func() { expectNoError(VerifySchedulerLatency()) }) - framework := NewFramework("density") - framework.NamespaceDeletionTimeout = time.Hour - framework.GatherKubeSystemResourceUsageData = testContext.GatherKubeSystemResourceUsageData - BeforeEach(func() { c = framework.Client ns = framework.Namespace.Name diff --git a/test/e2e/e2e_test.go b/test/e2e/e2e_test.go index 776e0d09176..dd4f26893c8 100644 --- a/test/e2e/e2e_test.go +++ b/test/e2e/e2e_test.go @@ -88,7 +88,7 @@ func init() { flag.BoolVar(&testContext.VerifyServiceAccount, "e2e-verify-service-account", true, "If true tests will verify the service account before running.") flag.BoolVar(&testContext.DeleteNamespace, "delete-namespace", true, "If true tests will delete namespace after completion. It is only designed to make debugging easier, DO NOT turn it off by default.") flag.BoolVar(&testContext.CleanStart, "clean-start", false, "If true, purge all namespaces except default and system before running tests. This serves to cleanup test namespaces from failed/interrupted e2e runs in a long-lived cluster.") - flag.BoolVar(&testContext.GatherKubeSystemResourceUsageData, "gather-resource-usage", true, "If set to true framework will be monitoring resource usage of system add-ons in (some) e2e tests.") + flag.BoolVar(&testContext.GatherKubeSystemResourceUsageData, "gather-resource-usage", false, "If set to true framework will be monitoring resource usage of system add-ons in (some) e2e tests.") } func TestE2E(t *testing.T) { diff --git a/test/e2e/framework.go b/test/e2e/framework.go index a307ef5d8b3..9b48c7a5328 100644 --- a/test/e2e/framework.go +++ b/test/e2e/framework.go @@ -41,10 +41,7 @@ type Framework struct { Client *client.Client NamespaceDeletionTimeout time.Duration - // If set to true 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. - GatherKubeSystemResourceUsageData bool - gatherer containerResourceGatherer + gatherer containerResourceGatherer } // NewFramework makes a new framework and sets up a BeforeEach/AfterEach for @@ -82,7 +79,7 @@ func (f *Framework) beforeEach() { Logf("Skipping waiting for service account") } - if f.GatherKubeSystemResourceUsageData { + if testContext.GatherKubeSystemResourceUsageData { f.gatherer.startGatheringData(c, time.Minute) } } @@ -126,7 +123,7 @@ func (f *Framework) afterEach() { Logf("Found DeleteNamespace=false, skipping namespace deletion!") } - if f.GatherKubeSystemResourceUsageData { + if testContext.GatherKubeSystemResourceUsageData { f.gatherer.stopAndPrintData([]int{50, 90, 99, 100}) } // Paranoia-- prevent reuse! diff --git a/test/e2e/util.go b/test/e2e/util.go index 83d70df873e..49a9696426a 100644 --- a/test/e2e/util.go +++ b/test/e2e/util.go @@ -120,22 +120,24 @@ type CloudConfig struct { } type TestContextType struct { - KubeConfig string - KubeContext string - CertDir string - Host string - RepoRoot string - Provider string - CloudConfig CloudConfig - KubectlPath string - OutputDir string - prefix string - MinStartupPods int - UpgradeTarget string - PrometheusPushGateway string - VerifyServiceAccount bool - DeleteNamespace bool - CleanStart bool + KubeConfig string + KubeContext string + CertDir string + Host string + RepoRoot string + Provider string + CloudConfig CloudConfig + KubectlPath string + OutputDir string + prefix string + MinStartupPods int + UpgradeTarget string + PrometheusPushGateway string + VerifyServiceAccount bool + DeleteNamespace bool + CleanStart bool + // If set to true 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. GatherKubeSystemResourceUsageData bool }