This is an automated email from the ASF dual-hosted git repository.
brandonwilliams pushed a commit to branch trunk
in repository https://gitbox.apache.org/repos/asf/cassandra-dtest.git
The following commit(s) were added to refs/heads/trunk by this push:
new 94142323 More intelligently detect compaction start in jmx_test
94142323 is described below
commit 94142323aaf7dbba45b7bddfe299cd0c1b8414f8
Author: Brandon Williams <[email protected]>
AuthorDate: Mon Jul 31 13:51:35 2023 -0500
More intelligently detect compaction start in jmx_test
Patch by brandonwilliams; reviewed by edimitrova for CASSANDRA-18709
---
jmx_test.py | 17 +++++++++++------
1 file changed, 11 insertions(+), 6 deletions(-)
diff --git a/jmx_test.py b/jmx_test.py
index 8f7f8834..02135686 100644
--- a/jmx_test.py
+++ b/jmx_test.py
@@ -197,11 +197,10 @@ class TestJMX(Tester):
node.flush()
# Run a major compaction. This will be the compaction whose
# progress we track.
- node.nodetool_process('compact')
+ node.nodetool_process('compact keyspace1')
# We need to sleep here to give compaction time to start
- # Why not do something smarter? Because if the bug regresses,
- # we can't rely on jmx to tell us that compaction started.
- time.sleep(5)
+ node.watch_log_for("Compacting")
+ time.sleep(2)
compaction_manager = make_mbean('db', type='CompactionManager')
with JolokiaAgent(node) as jmx:
@@ -215,8 +214,14 @@ class TestJMX(Tester):
var = 'Compaction@{uuid}(keyspace1, standard1,
{progress}/{total})bytes'
if self.cluster.version() >= LooseVersion('4.0'): # CASSANDRA-15954
var = 'Compaction({taskUuid}, {progress} / {total}
bytes)@{uuid}(keyspace1, standard1)'
- progress = int(parse.search(var,
progress_string).named['progress'])
- updated_progress = int(parse.search(var,
updated_progress_string).named['progress'])
+ parsed = parse.search(var, progress_string)
+ if parsed is None:
+ raise Exception("{} did not match {}".format(var,
progress_string))
+ progress = int(parsed.named['progress'])
+ parsed = parse.search(var, updated_progress_string)
+ if parsed is None:
+ raise Exception("{} did not match {}".format(var,
updated_progress_string))
+ updated_progress = int(parsed.named['progress'])
logger.debug(progress_string)
logger.debug(updated_progress_string)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]