Set ginkgo time if not specified explicitly
Signed-off-by: Davanum Srinivas <davanum@gmail.com>
This commit is contained in:
		@@ -153,9 +153,21 @@ func RunRemote(cfg RunRemoteConfig) (string, bool, error) {
 | 
				
			|||||||
		return "", false, fmt.Errorf("failed to create test result directory %q on Host %q: %v Output: %q", resultDir, cfg.Host, err, output)
 | 
							return "", false, fmt.Errorf("failed to create test result directory %q on Host %q: %v Output: %q", resultDir, cfg.Host, err, output)
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						allGinkgoFlags := cfg.GinkgoArgs
 | 
				
			||||||
 | 
						if !strings.Contains(allGinkgoFlags, "--timeout") {
 | 
				
			||||||
 | 
							klog.Warningf("ginkgo flags are missing explicit --timeout (ginkgo defaults to 60 minutes)")
 | 
				
			||||||
 | 
							// see https://github.com/onsi/ginkgo/blob/master/docs/index.md#:~:text=ginkgo%20%2D%2Dtimeout%3Dduration
 | 
				
			||||||
 | 
							// ginkgo suite timeout should be more than the default but less than the
 | 
				
			||||||
 | 
							// full test timeout, so we should use the average of the two.
 | 
				
			||||||
 | 
							suiteTimeout := int(testTimeout.Minutes())
 | 
				
			||||||
 | 
							suiteTimeout = (60 + suiteTimeout) / 2
 | 
				
			||||||
 | 
							allGinkgoFlags = fmt.Sprintf("%s --timeout=%dm", allGinkgoFlags, suiteTimeout)
 | 
				
			||||||
 | 
							klog.Infof("updated ginkgo flags: %s", allGinkgoFlags)
 | 
				
			||||||
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	klog.V(2).Infof("Running test on %q", cfg.Host)
 | 
						klog.V(2).Infof("Running test on %q", cfg.Host)
 | 
				
			||||||
	output, err := cfg.Suite.RunTest(cfg.Host, workspace, resultDir, cfg.ImageDesc, cfg.JunitFileName, cfg.TestArgs,
 | 
						output, err := cfg.Suite.RunTest(cfg.Host, workspace, resultDir, cfg.ImageDesc, cfg.JunitFileName, cfg.TestArgs,
 | 
				
			||||||
		cfg.GinkgoArgs, cfg.SystemSpecName, cfg.ExtraEnvs, cfg.RuntimeConfig, *testTimeout)
 | 
							allGinkgoFlags, cfg.SystemSpecName, cfg.ExtraEnvs, cfg.RuntimeConfig, *testTimeout)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	var aggErrs []error
 | 
						var aggErrs []error
 | 
				
			||||||
	// Do not log the Output here, let the caller deal with the test Output.
 | 
						// Do not log the Output here, let the caller deal with the test Output.
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user