mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-19 01:40:13 +00:00
Define the timeout
to 24h
for Ginkgo V2
Default timeout setting has been reduced from `24h` down to `1h` in Ginkgo V2, but for some long running test this is too short. How long to abort the test was controlled by the the linux command `timeout` in V1. e.g. `'timeout -k 30s 150m ...`, and is configured in the file like `sig-network-misc.yaml`. Set the timeout manually for Ginkgo V2 to avoid the early aborting. Signed-off-by: Dave Chen <dave.chen@arm.com>
This commit is contained in:
parent
2084f3cef2
commit
2f3028c00d
@ -166,9 +166,12 @@ elif [[ "${E2E_TEST_DEBUG_TOOL}" == "gdb" ]]; then
|
|||||||
program=("gdb")
|
program=("gdb")
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
# NOTE: Ginkgo's default timeout has been reduced from 24h to 1h in V2, set it manually here as "24h"
|
||||||
|
# for backward compatibility purpose.
|
||||||
"${program[@]}" "${ginkgo_args[@]:+${ginkgo_args[@]}}" "${e2e_test}" -- \
|
"${program[@]}" "${ginkgo_args[@]:+${ginkgo_args[@]}}" "${e2e_test}" -- \
|
||||||
"${auth_config[@]:+${auth_config[@]}}" \
|
"${auth_config[@]:+${auth_config[@]}}" \
|
||||||
--ginkgo.flakeAttempts="${FLAKE_ATTEMPTS}" \
|
--ginkgo.flakeAttempts="${FLAKE_ATTEMPTS}" \
|
||||||
|
--ginkgo.timeout="24h" \
|
||||||
--host="${KUBE_MASTER_URL}" \
|
--host="${KUBE_MASTER_URL}" \
|
||||||
--provider="${KUBERNETES_PROVIDER}" \
|
--provider="${KUBERNETES_PROVIDER}" \
|
||||||
--gce-project="${PROJECT:-}" \
|
--gce-project="${PROJECT:-}" \
|
||||||
|
@ -72,6 +72,20 @@ func getCmd(env Getenver, w io.Writer) *exec.Cmd {
|
|||||||
if len(env.Getenv(dryRunEnvKey)) > 0 {
|
if len(env.Getenv(dryRunEnvKey)) > 0 {
|
||||||
ginkgoArgs = append(ginkgoArgs, "--dryRun=true")
|
ginkgoArgs = append(ginkgoArgs, "--dryRun=true")
|
||||||
}
|
}
|
||||||
|
// NOTE: Ginkgo's default timeout has been reduced from 24h to 1h in V2, set it as "24h" for backward compatibility
|
||||||
|
// if this is not set by env of extraGinkgoArgsEnvKey.
|
||||||
|
exists := func(args []string) bool {
|
||||||
|
for _, arg := range args {
|
||||||
|
if strings.Contains(arg, "--timeout") {
|
||||||
|
return true
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return false
|
||||||
|
}(ginkgoArgs)
|
||||||
|
|
||||||
|
if !exists {
|
||||||
|
ginkgoArgs = append(ginkgoArgs, "--timeout=24h")
|
||||||
|
}
|
||||||
|
|
||||||
args := []string{}
|
args := []string{}
|
||||||
args = append(args, ginkgoArgs...)
|
args = append(args, ginkgoArgs...)
|
||||||
|
@ -39,7 +39,7 @@ func TestGetCmd(t *testing.T) {
|
|||||||
expectArgs: []string{
|
expectArgs: []string{
|
||||||
"ginkgobin",
|
"ginkgobin",
|
||||||
"--focus=", "--skip=",
|
"--focus=", "--skip=",
|
||||||
"--noColor=true", "testbin", "--",
|
"--noColor=true", "--timeout=24h", "testbin", "--",
|
||||||
"--disable-log-dump", "--repo-root=/kubernetes",
|
"--disable-log-dump", "--repo-root=/kubernetes",
|
||||||
"--provider=", "--report-dir=", "--kubeconfig=",
|
"--provider=", "--report-dir=", "--kubeconfig=",
|
||||||
},
|
},
|
||||||
@ -59,7 +59,7 @@ func TestGetCmd(t *testing.T) {
|
|||||||
expectArgs: []string{
|
expectArgs: []string{
|
||||||
"ginkgobin",
|
"ginkgobin",
|
||||||
"--focus=focus", "--skip=skip",
|
"--focus=focus", "--skip=skip",
|
||||||
"--noColor=true", "testbin", "--",
|
"--noColor=true", "--timeout=24h", "testbin", "--",
|
||||||
"--disable-log-dump", "--repo-root=/kubernetes",
|
"--disable-log-dump", "--repo-root=/kubernetes",
|
||||||
"--provider=provider", "--report-dir=results", "--kubeconfig=kubeconfig",
|
"--provider=provider", "--report-dir=results", "--kubeconfig=kubeconfig",
|
||||||
},
|
},
|
||||||
@ -75,7 +75,7 @@ func TestGetCmd(t *testing.T) {
|
|||||||
expectArgs: []string{
|
expectArgs: []string{
|
||||||
"ginkgobin", "--p",
|
"ginkgobin", "--p",
|
||||||
"--focus=", "--skip=\\[Serial\\]",
|
"--focus=", "--skip=\\[Serial\\]",
|
||||||
"--noColor=true", "testbin", "--",
|
"--noColor=true", "--timeout=24h", "testbin", "--",
|
||||||
"--disable-log-dump", "--repo-root=/kubernetes",
|
"--disable-log-dump", "--repo-root=/kubernetes",
|
||||||
"--provider=", "--report-dir=", "--kubeconfig=",
|
"--provider=", "--report-dir=", "--kubeconfig=",
|
||||||
},
|
},
|
||||||
@ -91,7 +91,7 @@ func TestGetCmd(t *testing.T) {
|
|||||||
},
|
},
|
||||||
expectArgs: []string{
|
expectArgs: []string{
|
||||||
"ginkgobin", "--focus=", "--skip=",
|
"ginkgobin", "--focus=", "--skip=",
|
||||||
"--noColor=true", "--ginkgo1", "--ginkgo2",
|
"--noColor=true", "--ginkgo1", "--ginkgo2", "--timeout=24h",
|
||||||
"testbin", "--",
|
"testbin", "--",
|
||||||
"--disable-log-dump", "--repo-root=/kubernetes",
|
"--disable-log-dump", "--repo-root=/kubernetes",
|
||||||
"--provider=", "--report-dir=", "--kubeconfig=",
|
"--provider=", "--report-dir=", "--kubeconfig=",
|
||||||
@ -110,12 +110,27 @@ func TestGetCmd(t *testing.T) {
|
|||||||
},
|
},
|
||||||
expectArgs: []string{
|
expectArgs: []string{
|
||||||
"ginkgobin", "--focus=", "--skip=",
|
"ginkgobin", "--focus=", "--skip=",
|
||||||
"--noColor=true", `--ginkgo='with "quotes" and '`, "--ginkgo2=true$(foo)",
|
"--noColor=true", `--ginkgo='with "quotes" and '`, "--ginkgo2=true$(foo)", "--timeout=24h",
|
||||||
"testbin", "--",
|
"testbin", "--",
|
||||||
"--disable-log-dump", "--repo-root=/kubernetes",
|
"--disable-log-dump", "--repo-root=/kubernetes",
|
||||||
"--provider=", "--report-dir=", "--kubeconfig=",
|
"--provider=", "--report-dir=", "--kubeconfig=",
|
||||||
"--extra=value with spaces", "--extra=value with % anything!$$",
|
"--extra=value with spaces", "--extra=value with % anything!$$",
|
||||||
},
|
},
|
||||||
|
}, {
|
||||||
|
desc: "Set Ginkgo timeout in env",
|
||||||
|
env: &explicitEnv{
|
||||||
|
vals: map[string]string{
|
||||||
|
ginkgoEnvKey: "ginkgobin",
|
||||||
|
testBinEnvKey: "testbin",
|
||||||
|
extraGinkgoArgsEnvKey: "--timeout=10h",
|
||||||
|
},
|
||||||
|
},
|
||||||
|
expectArgs: []string{
|
||||||
|
"ginkgobin", "--focus=", "--skip=",
|
||||||
|
"--noColor=true", "--timeout=10h", "testbin", "--",
|
||||||
|
"--disable-log-dump", "--repo-root=/kubernetes",
|
||||||
|
"--provider=", "--report-dir=", "--kubeconfig=",
|
||||||
|
},
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
for _, tc := range testCases {
|
for _, tc := range testCases {
|
||||||
|
@ -52,6 +52,10 @@ if [[ -n ${E2E_DRYRUN:-} ]]; then
|
|||||||
ginkgo_args+=("--dryRun=true")
|
ginkgo_args+=("--dryRun=true")
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
# NOTE: Ginkgo's default timeout has been reduced from 24h to 1h in V2, set it manually here as "24h"
|
||||||
|
# for backward compatibility purpose.
|
||||||
|
ginkgo_args+=("--timeout=24h")
|
||||||
|
|
||||||
case ${E2E_PARALLEL} in
|
case ${E2E_PARALLEL} in
|
||||||
'y'|'Y'|'true')
|
'y'|'Y'|'true')
|
||||||
# The flag '--p' will automatically detect the optimal number of ginkgo nodes.
|
# The flag '--p' will automatically detect the optimal number of ginkgo nodes.
|
||||||
|
Loading…
Reference in New Issue
Block a user