From 9c71eed490c3147bdd1982128f74fd38269beb4f Mon Sep 17 00:00:00 2001 From: Maor Blaustein Date: Wed, 19 Jun 2024 16:09:20 +0300 Subject: [PATCH] Increase rate/burst allowed offset I noticed this test became flaky once in a many runs over few months, only on upstream, regardless of neutron changes. The check which fails uses 2% offset from target value, which is small error margin, increasing to 5%. Change-Id: I3ca7b253557a199b812e50b67da4129a6ef3ab04 --- .../tests/scenario/test_security_group_logging.py | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/whitebox_neutron_tempest_plugin/tests/scenario/test_security_group_logging.py b/whitebox_neutron_tempest_plugin/tests/scenario/test_security_group_logging.py index 222f0af..dfa64df 100644 --- a/whitebox_neutron_tempest_plugin/tests/scenario/test_security_group_logging.py +++ b/whitebox_neutron_tempest_plugin/tests/scenario/test_security_group_logging.py @@ -631,9 +631,10 @@ class BaseSecGroupLoggingTest( quick_test_target = burst_limit + rate_limit quick_test_logs_amount = self._hypervisors_counts[ vm_a['hv_ssh_client'].host]['test_logs_amount'] + offset = 0.1 self.assertIn(quick_test_logs_amount, - range(round(0.9 * quick_test_target), - round(1.1 * quick_test_target)), + range(round((1 - offset) * quick_test_target), + round((1 + offset) * quick_test_target)), limits_fail_msg) # 16) send excessive ICMP requests to VM for 60 seconds self.start_track_log(vm_a['hv_ssh_client']) @@ -643,13 +644,14 @@ class BaseSecGroupLoggingTest( timeout=70) self.retrieve_tracked_log(vm_a['hv_ssh_client']) # 17) verify log entries amount equals to: - # rate limit * 60 + burst limit (up to 2% offset allowed) + # rate limit * 60 + burst limit (up to 5% offset allowed) long_test_target = rate_limit * 60 + burst_limit long_test_logs_amount = self._hypervisors_counts[ vm_a['hv_ssh_client'].host]['test_logs_amount'] + offset = 0.05 self.assertIn(long_test_logs_amount, - range(round(0.98 * long_test_target), - round(1.02 * long_test_target)), + range(round((1 - offset) * long_test_target), + round((1 + offset) * long_test_target)), limits_fail_msg) # NOTE(mblue): skip multi-compute test when setup is single node