From e3b813e7244f9db4584ce94cb4380bd0cb86360a Mon Sep 17 00:00:00 2001 From: mmsqe Date: Wed, 7 Aug 2024 15:11:34 +0800 Subject: [PATCH] Problem: no debug files uploaded when timeout in ci (#511) * Problem: no debug files uploaded when timeout in ci 30mins for marked, 1h for all in pytest * Apply suggestions from code review * set both --- scripts/run-integration-tests.sh | 4 ++-- tests/integration_tests/poetry.lock | 16 +++++++++++++++- tests/integration_tests/pyproject.toml | 1 + 3 files changed, 18 insertions(+), 3 deletions(-) diff --git a/scripts/run-integration-tests.sh b/scripts/run-integration-tests.sh index e867e392a9..869b079cf1 100755 --- a/scripts/run-integration-tests.sh +++ b/scripts/run-integration-tests.sh @@ -15,8 +15,8 @@ TESTS_TO_RUN="${TESTS_TO_RUN:-all}" if [[ "$TESTS_TO_RUN" == "all" ]]; then echo "run all tests" - pytest -vv -s + pytest -vv -s --session-timeout=3600 --timeout=3600 else echo "run tests matching $TESTS_TO_RUN" - pytest -vv -s -m "$TESTS_TO_RUN" + pytest -vv -s --session-timeout=1800 --timeout=1800 -m "$TESTS_TO_RUN" fi diff --git a/tests/integration_tests/poetry.lock b/tests/integration_tests/poetry.lock index eec61d6f31..f0623209a6 100644 --- a/tests/integration_tests/poetry.lock +++ b/tests/integration_tests/poetry.lock @@ -1682,6 +1682,20 @@ files = [ [package.dependencies] pytest = ">=4.0.0" +[[package]] +name = "pytest-timeout" +version = "2.3.1" +description = "pytest plugin to abort hanging tests" +optional = false +python-versions = ">=3.7" +files = [ + {file = "pytest-timeout-2.3.1.tar.gz", hash = "sha256:12397729125c6ecbdaca01035b9e5239d4db97352320af155b3f5de1ba5165d9"}, + {file = "pytest_timeout-2.3.1-py3-none-any.whl", hash = "sha256:68188cb703edfc6a18fad98dc25a3c61e9f24d644b0b70f33af545219fc7813e"}, +] + +[package.dependencies] +pytest = ">=7.0.0" + [[package]] name = "python-dateutil" version = "2.8.2" @@ -2438,4 +2452,4 @@ multidict = ">=4.0" [metadata] lock-version = "2.0" python-versions = "^3.9" -content-hash = "e2b24f3af2972f3799b6b7877084e48158b3dde1833c5837d32701f7ce81c42c" +content-hash = "65304e32f3e7250a07fb7efedcb7649c08d4a421ddbba9ce0b1b0097e3e3b277" diff --git a/tests/integration_tests/pyproject.toml b/tests/integration_tests/pyproject.toml index 01528df262..c7376e91fb 100644 --- a/tests/integration_tests/pyproject.toml +++ b/tests/integration_tests/pyproject.toml @@ -27,6 +27,7 @@ flaky = "^3.7" eth-bloom = "^3.0" eth-hash = "^0" jedi-language-server = "^0.41.3" +pytest-timeout = "^2.3.1" [tool.poetry.dev-dependencies]