Skip to content

Commit 2db4c4a

Browse files
committed
Set ginkgo time if not specified explicitly
Signed-off-by: Davanum Srinivas <[email protected]>
1 parent 3106279 commit 2db4c4a

File tree

1 file changed

+13
-1
lines changed

1 file changed

+13
-1
lines changed

test/e2e_node/remote/remote.go

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -153,9 +153,21 @@ func RunRemote(cfg RunRemoteConfig) (string, bool, error) {
153153
return "", false, fmt.Errorf("failed to create test result directory %q on Host %q: %v Output: %q", resultDir, cfg.Host, err, output)
154154
}
155155

156+
allGinkgoFlags := cfg.GinkgoArgs
157+
if !strings.Contains(allGinkgoFlags, "--timeout") {
158+
klog.Warningf("ginkgo flags are missing explicit --timeout (ginkgo defaults to 60 minutes)")
159+
// see https://github.com/onsi/ginkgo/blob/master/docs/index.md#:~:text=ginkgo%20%2D%2Dtimeout%3Dduration
160+
// ginkgo suite timeout should be more than the default but less than the
161+
// full test timeout, so we should use the average of the two.
162+
suiteTimeout := int(testTimeout.Minutes())
163+
suiteTimeout = (60 + suiteTimeout) / 2
164+
allGinkgoFlags = fmt.Sprintf("%s --timeout=%dm", allGinkgoFlags, suiteTimeout)
165+
klog.Infof("updated ginkgo flags: %s", allGinkgoFlags)
166+
}
167+
156168
klog.V(2).Infof("Running test on %q", cfg.Host)
157169
output, err := cfg.Suite.RunTest(cfg.Host, workspace, resultDir, cfg.ImageDesc, cfg.JunitFileName, cfg.TestArgs,
158-
cfg.GinkgoArgs, cfg.SystemSpecName, cfg.ExtraEnvs, cfg.RuntimeConfig, *testTimeout)
170+
allGinkgoFlags, cfg.SystemSpecName, cfg.ExtraEnvs, cfg.RuntimeConfig, *testTimeout)
159171

160172
var aggErrs []error
161173
// Do not log the Output here, let the caller deal with the test Output.

0 commit comments

Comments
 (0)