This is an automated email from the ASF dual-hosted git repository. jlewandowski pushed a commit to branch ds-trunk-5.0--2024-07-24 in repository https://gitbox.apache.org/repos/asf/cassandra-dtest.git
commit 651edfa5b37994b153714bd5be9e468ba2dd0ab7 Author: Brandon Williams <[email protected]> AuthorDate: Mon Jul 22 17:56:19 2024 -0500 CC5 fix test_disk_usage_guardrail --- guardrails_test.py | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/guardrails_test.py b/guardrails_test.py index bf883bba..7298c0ab 100644 --- a/guardrails_test.py +++ b/guardrails_test.py @@ -44,8 +44,11 @@ class TestGuardrails(BaseGuardrailsTester): """ self.fixture_dtest_setup.ignore_log_patterns = ["Write request failed because disk usage exceeds failure threshold"] - guardrails_config = {'guardrails': {'disk_usage_percentage_warn_threshold': 98, - 'disk_usage_percentage_failure_threshold': 99}} + if self.supports_guardrails(): + guardrails_config = {'guardrails': {'disk_usage_percentage_warn_threshold': 98, + 'disk_usage_percentage_failure_threshold': 99}} + else: + guardrails_config = {'data_disk_usage_percentage_warn_threshold': 98, 'data_disk_usage_percentage_fail_threshold': 99} logger.debug("prepare 2-node cluster with rf=1 and guardrails enabled") session = self.prepare(rf=1, nodes=2, options=guardrails_config, extra_jvm_args=['-Dcassandra.disk_usage.monitor_interval_ms=100'], install_byteman=True) @@ -83,7 +86,10 @@ class TestGuardrails(BaseGuardrailsTester): fut = session2.execute_async("INSERT INTO t(id, v) VALUES({v}, {v})".format(v=x)) fut.result() if fut.warnings: - assert ["Replica disk usage exceeds warn threshold"] == fut.warnings + if self.supports_guardrails(): + assert ["Replica disk usage exceeds warn threshold"] == fut.warnings + else: + assert ["Guardrail replica_disk_usage violated: Replica disk usage exceeds warning threshold"] == fut.warnings warnings = warnings + 1 assert rows != warnings,"Expect node2 emits some warnings, but got all warnings" --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
