Use timeout from ci_config in stress tests

This commit is contained in:
Mikhail f. Shiryaev 2024-05-16 20:13:56 +02:00
parent a2bfcabc99
commit 5f7839740d
No known key found for this signature in database
GPG Key ID: 4B02ED204C7D93F4
2 changed files with 4 additions and 13 deletions

View File

@ -483,6 +483,7 @@ stateful_test_common_params = {
stress_test_common_params = {
"digest": stress_check_digest,
"run_command": "stress_check.py",
"timeout": 9000,
}
upgrade_test_common_params = {
"digest": upgrade_check_digest,

View File

@ -14,7 +14,7 @@ from docker_images_helper import DockerImage, get_docker_image, pull_image
from env_helper import REPO_COPY, REPORT_PATH, TEMP_PATH
from get_robot_token import get_parameter_from_ssm
from pr_info import PRInfo
from report import ERROR, JobReport, TestResult, TestResults, read_test_results
from report import ERROR, JobReport, TestResults, read_test_results
from stopwatch import Stopwatch
from tee_popen import TeePopen
@ -161,14 +161,9 @@ def run_stress_test(docker_image_name: str) -> None:
)
logging.info("Going to run stress test: %s", run_command)
timeout_expired = False
timeout = 60 * 150
with TeePopen(run_command, run_log_path, timeout=timeout) as process:
with TeePopen(run_command, run_log_path) as process:
retcode = process.wait()
if process.timeout_exceeded:
logging.info("Timeout expired for command: %s", run_command)
timeout_expired = True
elif retcode == 0:
if retcode == 0:
logging.info("Run successfully")
else:
logging.info("Run failed")
@ -180,11 +175,6 @@ def run_stress_test(docker_image_name: str) -> None:
result_path, server_log_path, run_log_path
)
if timeout_expired:
test_results.append(TestResult.create_check_timeout_expired(timeout))
state = "failure"
description = test_results[-1].name
JobReport(
description=description,
test_results=test_results,