Skip to content

Commit

Permalink
Wait for compaction manager more intelligently
Browse files Browse the repository at this point in the history
Patch by brandonwilliams; reviewed by edimitrova for CASSANDRA-18709
  • Loading branch information
driftx committed Aug 3, 2023
1 parent 9414232 commit 8d45a2c
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions jmx_test.py
Expand Up @@ -200,11 +200,14 @@ def test_compactionstats(self):
node.nodetool_process('compact keyspace1')
# We need to sleep here to give compaction time to start
node.watch_log_for("Compacting")
time.sleep(2)

compaction_manager = make_mbean('db', type='CompactionManager')
with JolokiaAgent(node) as jmx:
progress_string = jmx.read_attribute(compaction_manager, 'CompactionSummary')[0]
summary = jmx.read_attribute(compaction_manager, 'CompactionSummary')
while (len(summary) < 1):
summary = jmx.read_attribute(compaction_manager, 'CompactionSummary')
time.sleep(1)
progress_string = summary[0]

# Pause in between reads
# to allow compaction to move forward
Expand Down

0 comments on commit 8d45a2c

Please sign in to comment.