From 1d746f7655bc238c0f39c9c99ce41d4d35619a87 Mon Sep 17 00:00:00 2001 From: hrj Date: Tue, 13 Apr 2021 14:26:50 +0530 Subject: [PATCH] functional test: reduce failure criteria Signed-off-by: hrj --- tests/locustfile-functional.py | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/tests/locustfile-functional.py b/tests/locustfile-functional.py index 21cfb92..c68d195 100644 --- a/tests/locustfile-functional.py +++ b/tests/locustfile-functional.py @@ -7,14 +7,12 @@ import subprocess @events.quitting.add_listener def _(environment, **kw): - if environment.stats.total.fail_ratio > 0.02: - logging.error("Test failed due to failure ratio > 2%") + totalStats = environment.stats.total + if totalStats.fail_ratio > 0.20: + logging.error("Test failed due to failure ratio " + totalStats.fail_ratio + " > 20%") environment.process_exit_code = 1 - elif environment.stats.total.avg_response_time > 300: - logging.error("Test failed due to average response time ratio > 300 ms") - environment.process_exit_code = 1 - elif environment.stats.total.get_response_time_percentile(0.95) > 800: - logging.error("Test failed due to 95th percentile response time > 800 ms") + elif totalStats.get_response_time_percentile(0.80) > 800: + logging.error("Test failed due to 80th percentile response time > 800 ms") environment.process_exit_code = 1 else: environment.process_exit_code = 0