@@ -153,9 +153,21 @@ func RunRemote(cfg RunRemoteConfig) (string, bool, error) {
153
153
return "" , false , fmt .Errorf ("failed to create test result directory %q on Host %q: %v Output: %q" , resultDir , cfg .Host , err , output )
154
154
}
155
155
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
+
156
168
klog .V (2 ).Infof ("Running test on %q" , cfg .Host )
157
169
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 )
159
171
160
172
var aggErrs []error
161
173
// Do not log the Output here, let the caller deal with the test Output.
0 commit comments