Browse code

test: remove platform related timeout values

These were dependent on the DOCKER_ENGINE_GOARCH environment variable
but this var was no longer set. There was also some weird check to see
if the architecture is "windows" which doesn't make sense. Seeing how
nothing failed ever since the TIMEOUT was no longer platform-dependent
we can safely remove this check.

Signed-off-by: Djordje Lukic <djordje.lukic@docker.com>

Djordje Lukic authored on 2023/08/31 17:39:28
Showing 2 changed files
... ...
@@ -14,6 +14,7 @@ source "${MAKEDIR}/.go-autogen"
14 14
 
15 15
 # Set defaults
16 16
 : "${TEST_REPEAT:=1}"
17
+: "${TIMEOUT:=5m}"
17 18
 : "${TESTFLAGS:=}"
18 19
 : "${TESTDEBUG:=}"
19 20
 : "${TESTCOVERAGE:=}"
... ...
@@ -54,7 +55,7 @@ else
54 54
 fi
55 55
 
56 56
 run_test_integration() {
57
-	set_platform_timeout
57
+	set_repeat_timeout
58 58
 	local failed=0
59 59
 	if [ -z "${TEST_SKIP_INTEGRATION}" ]; then
60 60
 		if ! run_test_integration_suites "${integration_api_dirs}"; then
... ...
@@ -181,7 +182,6 @@ test_env() {
181 181
 			DOCKER_INTEGRATION_DAEMON_DEST="$DOCKER_INTEGRATION_DAEMON_DEST" \
182 182
 			DOCKER_TLS_VERIFY="$DOCKER_TEST_TLS_VERIFY" \
183 183
 			DOCKER_CERT_PATH="$DOCKER_TEST_CERT_PATH" \
184
-			DOCKER_ENGINE_GOARCH="$DOCKER_ENGINE_GOARCH" \
185 184
 			DOCKER_GRAPHDRIVER="$DOCKER_GRAPHDRIVER" \
186 185
 			DOCKER_USERLANDPROXY="$DOCKER_USERLANDPROXY" \
187 186
 			DOCKER_HOST="$DOCKER_HOST" \
... ...
@@ -201,16 +201,7 @@ test_env() {
201 201
 	)
202 202
 }
203 203
 
204
-set_platform_timeout() {
205
-	# Test timeout.
206
-	if [ "${DOCKER_ENGINE_GOARCH}" = "arm64" ] || [ "${DOCKER_ENGINE_GOARCH}" = "arm" ]; then
207
-		: "${TIMEOUT:=10m}"
208
-	elif [ "${DOCKER_ENGINE_GOARCH}" = "windows" ]; then
209
-		: "${TIMEOUT:=8m}"
210
-	else
211
-		: "${TIMEOUT:=5m}"
212
-	fi
213
-
204
+set_repeat_timeout() {
214 205
 	if [ "${TEST_REPEAT}" -gt 1 ]; then
215 206
 		# TIMEOUT needs to take TEST_REPEAT into account, or a premature time out may happen.
216 207
 		# The following ugliness will:
... ...
@@ -1,13 +1,6 @@
1 1
 #!/usr/bin/env bash
2 2
 set -e -u -o pipefail
3 3
 
4
-ARCH=$(uname -m)
5
-if [ "$ARCH" = "x86_64" ]; then
6
-	ARCH="amd64"
7
-fi
8
-
9
-export DOCKER_ENGINE_GOARCH=${DOCKER_ENGINE_GOARCH:-${ARCH}}
10
-
11 4
 # Set defaults
12 5
 : ${TESTFLAGS:=}
13 6
 : ${TESTDEBUG:=}
... ...
@@ -18,13 +11,12 @@ integration_api_dirs=${TEST_INTEGRATION_DIR:-"$(
18 18
 )"}
19 19
 
20 20
 run_test_integration() {
21
-	set_platform_timeout
22 21
 	run_test_integration_suites
23 22
 	run_test_integration_legacy_suites
24 23
 }
25 24
 
26 25
 run_test_integration_suites() {
27
-	local flags="-test.v -test.timeout=${TIMEOUT:-10m} $TESTFLAGS"
26
+	local flags="-test.v -test.timeout=${TIMEOUT} $TESTFLAGS"
28 27
 	for dir in $integration_api_dirs; do
29 28
 		if ! (
30 29
 			cd $dir
... ...
@@ -53,7 +45,6 @@ test_env() {
53 53
 			DOCKER_INTEGRATION_DAEMON_DEST="$DOCKER_INTEGRATION_DAEMON_DEST" \
54 54
 			DOCKER_TLS_VERIFY="$DOCKER_TEST_TLS_VERIFY" \
55 55
 			DOCKER_CERT_PATH="$DOCKER_TEST_CERT_PATH" \
56
-			DOCKER_ENGINE_GOARCH="$DOCKER_ENGINE_GOARCH" \
57 56
 			DOCKER_GRAPHDRIVER="$DOCKER_GRAPHDRIVER" \
58 57
 			DOCKER_USERLANDPROXY="$DOCKER_USERLANDPROXY" \
59 58
 			DOCKER_HOST="$DOCKER_HOST" \
... ...
@@ -69,16 +60,5 @@ test_env() {
69 69
 	)
70 70
 }
71 71
 
72
-set_platform_timeout() {
73
-	# Test timeout.
74
-	if [ "${DOCKER_ENGINE_GOARCH}" = "arm64" ] || [ "${DOCKER_ENGINE_GOARCH}" = "arm" ]; then
75
-		: ${TIMEOUT:=10m}
76
-	elif [ "${DOCKER_ENGINE_GOARCH}" = "windows" ]; then
77
-		: ${TIMEOUT:=8m}
78
-	else
79
-		: ${TIMEOUT:=5m}
80
-	fi
81
-}
82
-
83 72
 sh /scripts/build-empty-images.sh
84 73
 run_test_integration