This repository was archived by the owner on Sep 17, 2024. It is now read-only.
File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -48,7 +48,6 @@ func setUpSuite() {
4848 }
4949 common .AgentVersionBase = v
5050
51- common .TimeoutFactor = shell .GetEnvInteger ("TIMEOUT_FACTOR" , common .TimeoutFactor )
5251 common .AgentVersion = shell .GetEnv ("BEAT_VERSION" , common .AgentVersionBase )
5352
5453 // check if version is an alias
Original file line number Diff line number Diff line change @@ -37,10 +37,6 @@ var elasticAPMActive = false
3737
3838var helmManager helm.Manager
3939
40- // timeoutFactor a multiplier for the max timeout when doing backoff retries.
41- // It can be overriden by TIMEOUT_FACTOR env var
42- var timeoutFactor = 2
43-
4440//nolint:unused
4541var kubectlClient kubectl.Kubectl
4642
@@ -80,7 +76,6 @@ func setupSuite() {
8076 helmVersion = shell .GetEnv ("HELM_VERSION" , helmVersion )
8177 helmChartVersion = shell .GetEnv ("HELM_CHART_VERSION" , helmChartVersion )
8278 kubernetesVersion = shell .GetEnv ("KUBERNETES_VERSION" , kubernetesVersion )
83- timeoutFactor = shell .GetEnvInteger ("TIMEOUT_FACTOR" , timeoutFactor )
8479
8580 stackVersion = shell .GetEnv ("STACK_VERSION" , stackVersion )
8681 v , err := utils .GetElasticArtifactVersion (stackVersion )
@@ -187,7 +182,7 @@ func (ts *HelmChartTestSuite) aResourceWillExposePods(resourceType string) error
187182 return err
188183 }
189184
190- maxTimeout := time .Duration (timeoutFactor ) * time .Minute
185+ maxTimeout := time .Duration (common . TimeoutFactor ) * time .Minute
191186
192187 exp := common .GetExponentialBackOff (maxTimeout )
193188 retryCount := 1
Original file line number Diff line number Diff line change @@ -37,14 +37,6 @@ const defaultBeatVersion = "8.0.0-SNAPSHOT"
3737var defaultEventsWaitTimeout = 60 * time .Second
3838var defaultDeployWaitTimeout = 60 * time .Second
3939
40- func init () {
41- // initialise timeout factor
42- common .TimeoutFactor = shell .GetEnvInteger ("TIMEOUT_FACTOR" , common .TimeoutFactor )
43-
44- defaultEventsWaitTimeout = defaultEventsWaitTimeout * time .Duration (common .TimeoutFactor )
45- defaultDeployWaitTimeout = defaultDeployWaitTimeout * time .Duration (common .TimeoutFactor )
46- }
47-
4840type podsManager struct {
4941 kubectl kubernetes.Control
5042 ctx context.Context
@@ -472,6 +464,9 @@ func InitializeTestSuite(ctx *godog.TestSuiteContext) {
472464 // init logger
473465 config .Init ()
474466
467+ defaultEventsWaitTimeout = defaultEventsWaitTimeout * time .Duration (common .TimeoutFactor )
468+ defaultDeployWaitTimeout = defaultDeployWaitTimeout * time .Duration (common .TimeoutFactor )
469+
475470 err := cluster .Initialize (suiteContext , "testdata/kind.yml" )
476471 if err != nil {
477472 log .WithError (err ).Fatal ("Failed to initialize cluster" )
Original file line number Diff line number Diff line change @@ -8,12 +8,17 @@ import (
88 "time"
99
1010 backoff "github.com/cenkalti/backoff/v4"
11+ "github.com/elastic/e2e-testing/internal/shell"
1112)
1213
1314// TimeoutFactor a multiplier for the max timeout when doing backoff retries.
1415// It can be overriden by TIMEOUT_FACTOR env var
1516var TimeoutFactor = 3
1617
18+ func init () {
19+ TimeoutFactor = shell .GetEnvInteger ("TIMEOUT_FACTOR" , TimeoutFactor )
20+ }
21+
1722// GetExponentialBackOff returns a preconfigured exponential backoff instance
1823func GetExponentialBackOff (elapsedTime time.Duration ) * backoff.ExponentialBackOff {
1924 var (
You can’t perform that action at this time.
0 commit comments