From cab25d69de53fd4e0b193ad214bcd6d24ef09208 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Piotr=20Ma=C5=9Blanka?= <piotr.maslanka@ericsson.com> Date: Mon, 2 Sep 2024 15:31:00 +0200 Subject: [PATCH] longer stress tests --- CHANGELOG.md | 1 + stress_tests/client.py | 5 ++++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index e44b4d0..476eae3 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,3 +7,4 @@ have been made so far, between releases. * removed the requirement for a Queue that for it to be equal to other Queue if their types do match * compile_definitions will now depend on requests * added support for infinite (None) timeouts during start +* stress tests will run for 60 seconds now diff --git a/stress_tests/client.py b/stress_tests/client.py index 00f4296..f2e6427 100644 --- a/stress_tests/client.py +++ b/stress_tests/client.py @@ -19,6 +19,9 @@ CONNECTIONS_PER_SECOND = 0.9 DISCONNECTS_PER_SECOND_PER_CONNECTION = 0.1 ANSWER_PROBABILITY = 0.7 +RUNNING_INTERVAL = 60 # run for 60 seconds + + def run_multiple_if_probability(probability: float, callable: tp.Callable[[], None]) -> None: prob = random.random() @@ -118,7 +121,7 @@ def run(client_notify, result_client, server_notify, server_result): cad.start() started_at = time.monotonic() terminating = False - while not terminating and (time.monotonic() < started_at + 40): # run for 40 seconds + while not terminating and (time.monotonic() < started_at + RUNNING_INTERVAL): # run for however long is required try: client_notify.get(timeout=1.0) terminating = True -- GitLab