hs-test: configurable Ginkgo timeout 59/43159/5
authorAdrian Villin <[email protected]>
Thu, 12 Jun 2025 12:35:49 +0000 (14:35 +0200)
committerFlorin Coras <[email protected]>
Thu, 12 Jun 2025 21:01:13 +0000 (21:01 +0000)
- global Ginkgo timeout can now be set using GINKGO_TIMEOUT
- fixes coverage job timing out because of Ginkgo's default 1h timeout

Type: fix

Change-Id: Ie1386e3eab31ff843a94b991e43b5270772b7732
Signed-off-by: Adrian Villin <[email protected]>
extras/hs-test/Makefile
extras/hs-test/hs_test.sh

index b02c499..c2885b2 100644 (file)
@@ -69,6 +69,10 @@ ifeq ($(TIMEOUT),)
 TIMEOUT=5
 endif
 
+ifeq ($(GINKGO_TIMEOUT),)
+GINKGO_TIMEOUT=3h
+endif
+
 FORCE_BUILD?=true
 
 .PHONY: help
@@ -109,6 +113,7 @@ help:
        @echo " DRYRUN=[true|false]      - set up containers but don't run tests"
        @echo " NO_COLOR=[true|false]    - disables colorful Docker and Ginkgo output"
        @echo " TIMEOUT=[minutes]        - test timeout override (5 minutes by default)"
+       @echo " GINKGO_TIMEOUT=[Ns/m/h]  - Ginkgo timeout override (3h by default)"
 
 .PHONY: list-tests
 list-tests:
@@ -143,7 +148,7 @@ test: .deps.ok .build.ok
                --unconfigure=$(UNCONFIGURE) --debug=$(DEBUG) --test=$(TEST) --cpus=$(CPUS) \
                --vppsrc=$(VPPSRC) --parallel=$(PARALLEL) --repeat=$(REPEAT) --cpu0=$(CPU0) \
                --dryrun=$(DRYRUN) --skip=$(SKIP) --no_color=$(NO_COLOR) --timeout=$(TIMEOUT) \
-               --vpp_cpus=$(VPP_CPUS); \
+               --ginkgo_timeout=$(GINKGO_TIMEOUT) --vpp_cpus=$(VPP_CPUS); \
                ./script/compress.sh $$?
 
 .PHONY: test-debug
@@ -153,7 +158,7 @@ test-debug: .deps.ok .build_debug.ok
                --unconfigure=$(UNCONFIGURE) --debug=$(DEBUG) --test=$(TEST) --cpus=$(CPUS) \
                --vppsrc=$(VPPSRC) --parallel=$(PARALLEL) --repeat=$(REPEAT) --debug_build=true \
                --cpu0=$(CPU0) --dryrun=$(DRYRUN) --skip=$(SKIP) --no_color=$(NO_COLOR) --timeout=$(TIMEOUT) \
-               --vpp_cpus=$(VPP_CPUS); \
+               --ginkgo_timeout=$(GINKGO_TIMEOUT) --vpp_cpus=$(VPP_CPUS); \
                ./script/compress.sh $$?
 
 .PHONY: wipe-lcov
@@ -166,21 +171,22 @@ test-cov: .deps.ok .build.cov.ok wipe-lcov
        -@bash ./hs_test.sh --coverage=true --persist=$(PERSIST) --verbose=$(VERBOSE) \
                --unconfigure=$(UNCONFIGURE) --debug=$(DEBUG) --test=$(TEST-HS) --cpus=$(CPUS) \
                --vppsrc=$(VPPSRC) --cpu0=$(CPU0) --dryrun=$(DRYRUN) --skip=$(SKIP) --no_color=$(NO_COLOR) \
-               --timeout=$(TIMEOUT) --vpp_cpus=$(VPP_CPUS); \
+               --timeout=$(TIMEOUT) --ginkgo_timeout=$(GINKGO_TIMEOUT) --vpp_cpus=$(VPP_CPUS); \
                ./script/compress.sh $$?
        $(MAKE) -C ../.. test-cov-post-standalone HS_TEST=1
 
 .PHONY: test-leak
 test-leak: .deps.ok .build_debug.ok
        @bash ./hs_test.sh --test=$(TEST) --debug_build=true --leak_check=true --vppsrc=$(VPPSRC) --timeout=$(TIMEOUT) \
-       --vpp_cpus=$(VPP_CPUS);
+       --ginkgo_timeout=$(GINKGO_TIMEOUT) --vpp_cpus=$(VPP_CPUS);
 
 .PHONY: test-perf
 test-perf: FORCE_BUILD=false
 test-perf: .deps.ok .build.ok
        @bash ./hs_test.sh --persist=$(PERSIST) --verbose=$(VERBOSE) \
                --test=$(TEST) --vppsrc=$(VPPSRC) --repeat=$(REPEAT) \
-               --skip=$(SKIP) --no_color=$(NO_COLOR) --perf=true --timeout=$(TIMEOUT); \
+               --skip=$(SKIP) --no_color=$(NO_COLOR) --perf=true --timeout=$(TIMEOUT) \
+               --ginkgo_timeout=$(GINKGO_TIMEOUT); \
                ./script/compress.sh $$?
 
 .PHONY: setup-cluster
index eb3607c..0254d0b 100644 (file)
@@ -86,6 +86,9 @@ case "${i}" in
     --parallel=*)
         ginkgo_args="$ginkgo_args -procs=${i#*=}"
         ;;
+    --ginkgo_timeout=*)
+        ginkgo_args="$ginkgo_args --timeout=${i#*=}"
+        ;;
     --repeat=*)
         ginkgo_args="$ginkgo_args --repeat=${i#*=}"
         ;;
@@ -183,7 +186,9 @@ fi
 
 mkdir -p summary
 # shellcheck disable=SC2086
-sudo -E go run github.com/onsi/ginkgo/v2/ginkgo --json-report=summary/report.json $ginkgo_args -- $args
+CMD="sudo -E go run github.com/onsi/ginkgo/v2/ginkgo --json-report=summary/report.json $ginkgo_args -- $args"
+echo "$CMD"
+$CMD
 exit_status=$?
 
 if [ -e "summary/failed-summary.log" ]; then