瀏覽代碼

Merge pull request #46380 from rumpl/test-platform-timeout

test: remove platform related timeout values
Sebastiaan van Stijn 1 年之前
父節點
當前提交
02db973460
共有 2 個文件被更改,包括 4 次插入33 次删除
  1. 3 12
      hack/make/.integration-test-helpers
  2. 1 21
      hack/test/e2e-run.sh

+ 3 - 12
hack/make/.integration-test-helpers

@@ -14,6 +14,7 @@ source "${MAKEDIR}/.go-autogen"
 
 
 # Set defaults
 # Set defaults
 : "${TEST_REPEAT:=1}"
 : "${TEST_REPEAT:=1}"
+: "${TIMEOUT:=5m}"
 : "${TESTFLAGS:=}"
 : "${TESTFLAGS:=}"
 : "${TESTDEBUG:=}"
 : "${TESTDEBUG:=}"
 : "${TESTCOVERAGE:=}"
 : "${TESTCOVERAGE:=}"
@@ -54,7 +55,7 @@ else
 fi
 fi
 
 
 run_test_integration() {
 run_test_integration() {
-	set_platform_timeout
+	set_repeat_timeout
 	local failed=0
 	local failed=0
 	if [ -z "${TEST_SKIP_INTEGRATION}" ]; then
 	if [ -z "${TEST_SKIP_INTEGRATION}" ]; then
 		if ! run_test_integration_suites "${integration_api_dirs}"; then
 		if ! run_test_integration_suites "${integration_api_dirs}"; then
@@ -181,7 +182,6 @@ test_env() {
 			DOCKER_INTEGRATION_DAEMON_DEST="$DOCKER_INTEGRATION_DAEMON_DEST" \
 			DOCKER_INTEGRATION_DAEMON_DEST="$DOCKER_INTEGRATION_DAEMON_DEST" \
 			DOCKER_TLS_VERIFY="$DOCKER_TEST_TLS_VERIFY" \
 			DOCKER_TLS_VERIFY="$DOCKER_TEST_TLS_VERIFY" \
 			DOCKER_CERT_PATH="$DOCKER_TEST_CERT_PATH" \
 			DOCKER_CERT_PATH="$DOCKER_TEST_CERT_PATH" \
-			DOCKER_ENGINE_GOARCH="$DOCKER_ENGINE_GOARCH" \
 			DOCKER_GRAPHDRIVER="$DOCKER_GRAPHDRIVER" \
 			DOCKER_GRAPHDRIVER="$DOCKER_GRAPHDRIVER" \
 			DOCKER_USERLANDPROXY="$DOCKER_USERLANDPROXY" \
 			DOCKER_USERLANDPROXY="$DOCKER_USERLANDPROXY" \
 			DOCKER_HOST="$DOCKER_HOST" \
 			DOCKER_HOST="$DOCKER_HOST" \
@@ -201,16 +201,7 @@ test_env() {
 	)
 	)
 }
 }
 
 
-set_platform_timeout() {
-	# Test timeout.
-	if [ "${DOCKER_ENGINE_GOARCH}" = "arm64" ] || [ "${DOCKER_ENGINE_GOARCH}" = "arm" ]; then
-		: "${TIMEOUT:=10m}"
-	elif [ "${DOCKER_ENGINE_GOARCH}" = "windows" ]; then
-		: "${TIMEOUT:=8m}"
-	else
-		: "${TIMEOUT:=5m}"
-	fi
-
+set_repeat_timeout() {
 	if [ "${TEST_REPEAT}" -gt 1 ]; then
 	if [ "${TEST_REPEAT}" -gt 1 ]; then
 		# TIMEOUT needs to take TEST_REPEAT into account, or a premature time out may happen.
 		# TIMEOUT needs to take TEST_REPEAT into account, or a premature time out may happen.
 		# The following ugliness will:
 		# The following ugliness will:

+ 1 - 21
hack/test/e2e-run.sh

@@ -1,13 +1,6 @@
 #!/usr/bin/env bash
 #!/usr/bin/env bash
 set -e -u -o pipefail
 set -e -u -o pipefail
 
 
-ARCH=$(uname -m)
-if [ "$ARCH" = "x86_64" ]; then
-	ARCH="amd64"
-fi
-
-export DOCKER_ENGINE_GOARCH=${DOCKER_ENGINE_GOARCH:-${ARCH}}
-
 # Set defaults
 # Set defaults
 : ${TESTFLAGS:=}
 : ${TESTFLAGS:=}
 : ${TESTDEBUG:=}
 : ${TESTDEBUG:=}
@@ -18,13 +11,12 @@ integration_api_dirs=${TEST_INTEGRATION_DIR:-"$(
 )"}
 )"}
 
 
 run_test_integration() {
 run_test_integration() {
-	set_platform_timeout
 	run_test_integration_suites
 	run_test_integration_suites
 	run_test_integration_legacy_suites
 	run_test_integration_legacy_suites
 }
 }
 
 
 run_test_integration_suites() {
 run_test_integration_suites() {
-	local flags="-test.v -test.timeout=${TIMEOUT:-10m} $TESTFLAGS"
+	local flags="-test.v -test.timeout=${TIMEOUT} $TESTFLAGS"
 	for dir in $integration_api_dirs; do
 	for dir in $integration_api_dirs; do
 		if ! (
 		if ! (
 			cd $dir
 			cd $dir
@@ -53,7 +45,6 @@ test_env() {
 			DOCKER_INTEGRATION_DAEMON_DEST="$DOCKER_INTEGRATION_DAEMON_DEST" \
 			DOCKER_INTEGRATION_DAEMON_DEST="$DOCKER_INTEGRATION_DAEMON_DEST" \
 			DOCKER_TLS_VERIFY="$DOCKER_TEST_TLS_VERIFY" \
 			DOCKER_TLS_VERIFY="$DOCKER_TEST_TLS_VERIFY" \
 			DOCKER_CERT_PATH="$DOCKER_TEST_CERT_PATH" \
 			DOCKER_CERT_PATH="$DOCKER_TEST_CERT_PATH" \
-			DOCKER_ENGINE_GOARCH="$DOCKER_ENGINE_GOARCH" \
 			DOCKER_GRAPHDRIVER="$DOCKER_GRAPHDRIVER" \
 			DOCKER_GRAPHDRIVER="$DOCKER_GRAPHDRIVER" \
 			DOCKER_USERLANDPROXY="$DOCKER_USERLANDPROXY" \
 			DOCKER_USERLANDPROXY="$DOCKER_USERLANDPROXY" \
 			DOCKER_HOST="$DOCKER_HOST" \
 			DOCKER_HOST="$DOCKER_HOST" \
@@ -69,16 +60,5 @@ test_env() {
 	)
 	)
 }
 }
 
 
-set_platform_timeout() {
-	# Test timeout.
-	if [ "${DOCKER_ENGINE_GOARCH}" = "arm64" ] || [ "${DOCKER_ENGINE_GOARCH}" = "arm" ]; then
-		: ${TIMEOUT:=10m}
-	elif [ "${DOCKER_ENGINE_GOARCH}" = "windows" ]; then
-		: ${TIMEOUT:=8m}
-	else
-		: ${TIMEOUT:=5m}
-	fi
-}
-
 sh /scripts/build-empty-images.sh
 sh /scripts/build-empty-images.sh
 run_test_integration
 run_test_integration