Merge pull request #125993 from macsko/increase_server_timeout_in_scheduler_perf_tests

Increase API server timeout in scheduler_perf integration tests
This commit is contained in:
Kubernetes Prow Robot 2024-07-16 08:15:10 -07:00 committed by GitHub
commit 5f7cfdef11
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 9 additions and 1 deletions

View File

@ -104,6 +104,8 @@ type TestServerInstanceOptions struct {
// Set the BinaryVersion of server effective version.
// Default to 1.31
BinaryVersion string
// Set non-default request timeout in the server.
RequestTimeout time.Duration
}
// TestServer return values supplied by kube-test-ApiServer
@ -194,6 +196,9 @@ func StartTestServer(t ktesting.TB, instanceOptions *TestServerInstanceOptions,
utilruntime.Must(utilversion.DefaultComponentGlobalsRegistry.Register(utilversion.DefaultKubeComponent, effectiveVersion, featureGate))
s := options.NewServerRunOptions()
if instanceOptions.RequestTimeout > 0 {
s.GenericServerRunOptions.RequestTimeout = instanceOptions.RequestTimeout
}
for _, f := range s.Flags().FlagSets {
fs.AddFlagSet(f)

View File

@ -94,7 +94,10 @@ func mustSetupCluster(tCtx ktesting.TContext, config *config.KubeSchedulerConfig
"--disable-admission-plugins=ServiceAccount,TaintNodesByCondition,Priority",
"--runtime-config=" + strings.Join(runtimeConfig, ","),
}
server, err := apiservertesting.StartTestServer(tCtx, apiservertesting.NewDefaultTestServerOptions(), customFlags, framework.SharedEtcd())
serverOpts := apiservertesting.NewDefaultTestServerOptions()
// Timeout sufficiently long to handle deleting pods of the largest test cases.
serverOpts.RequestTimeout = 10 * time.Minute
server, err := apiservertesting.StartTestServer(tCtx, serverOpts, customFlags, framework.SharedEtcd())
if err != nil {
tCtx.Fatalf("start apiserver: %v", err)
}