You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cassandra.apache.org by br...@apache.org on 2022/01/26 13:15:52 UTC
[cassandra-dtest] 01/02: Use function to generate explicit byteman path
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
commit 963dbba6f44ea3ca9f40279b82dd43a2095c25ab
Author: Brandon Williams <br...@apache.org>
AuthorDate: Tue Jan 25 14:37:38 2022 -0600
Use function to generate explicit byteman path
Patch by brandonwilliams; reviewed by bereng for CASSANDRA-17265
---
batch_test.py | 2 +-
bootstrap_test.py | 10 ++---
counter_test.py | 12 +++---
cql_test.py | 4 +-
dtest.py | 5 +++
materialized_views_test.py | 20 +++++-----
read_repair_test.py | 78 +++++++++++++++++++-------------------
rebuild_test.py | 6 +--
repair_tests/repair_test.py | 4 +-
replace_address_test.py | 6 +--
replica_side_filtering_test.py | 4 +-
secondary_indexes_test.py | 10 ++---
sstable_generation_loading_test.py | 4 +-
topology_test.py | 6 +--
transient_replication_test.py | 22 +++++------
15 files changed, 99 insertions(+), 94 deletions(-)
diff --git a/batch_test.py b/batch_test.py
index 2dad0d3..2d928d8 100644
--- a/batch_test.py
+++ b/batch_test.py
@@ -377,7 +377,7 @@ class TestBatch(Tester):
protocol_version=protocol_version, install_byteman=True)
coordinator = self.cluster.nodelist()[coordinator_idx]
- coordinator.byteman_submit(['./byteman/fail_after_batchlog_write.btm'])
+ coordinator.byteman_submit([mk_bman_path('fail_after_batchlog_write.btm')])
logger.debug("Injected byteman scripts to enable batchlog replay {}".format(coordinator.name))
query = """
diff --git a/bootstrap_test.py b/bootstrap_test.py
index 9678f56..06190e9 100644
--- a/bootstrap_test.py
+++ b/bootstrap_test.py
@@ -17,7 +17,7 @@ import pytest
from distutils.version import LooseVersion
-from dtest import Tester, create_ks, create_cf, data_size
+from dtest import Tester, create_ks, create_cf, data_size, mk_bman_path
from tools.assertions import (assert_almost_equal, assert_bootstrap_state, assert_not_running,
assert_one, assert_stderr_clean)
from tools.data import query_c1c2
@@ -30,8 +30,8 @@ logger = logging.getLogger(__name__)
class BootstrapTester(Tester):
- byteman_submit_path_pre_4_0 = './byteman/pre4.0/stream_failure.btm'
- byteman_submit_path_4_0 = './byteman/4.0/stream_failure.btm'
+ byteman_submit_path_pre_4_0 = mk_bman_path('pre4.0/stream_failure.btm')
+ byteman_submit_path_4_0 = mk_bman_path('4.0/stream_failure.btm')
@pytest.fixture(autouse=True)
def fixture_add_additional_log_patterns(self, fixture_dtest_setup):
@@ -189,7 +189,7 @@ class BootstrapTester(Tester):
logger.debug("Submitting byteman script to {} to".format(node1.name))
# Sleep longer than streaming_socket_timeout_in_ms to make sure the node will not be killed
- node1.byteman_submit(['./byteman/stream_5s_sleep.btm'])
+ node1.byteman_submit([mk_bman_path('stream_5s_sleep.btm')])
# Bootstraping a new node with very small streaming_socket_timeout_in_ms
node2 = new_node(cluster)
@@ -286,7 +286,7 @@ class BootstrapTester(Tester):
logger.debug("Bootstrap node 2 with delay")
node2 = new_node(cluster, byteman_port='4200')
- node2.update_startup_byteman_script('./byteman/bootstrap_5s_sleep.btm')
+ node2.update_startup_byteman_script(mk_bman_path('bootstrap_5s_sleep.btm'))
node2.start(wait_for_binary_proto=True)
assert_bootstrap_state(self, node2, 'COMPLETED')
diff --git a/counter_test.py b/counter_test.py
index 6b7587a..b596874 100644
--- a/counter_test.py
+++ b/counter_test.py
@@ -8,7 +8,7 @@ from cassandra import ConsistencyLevel
from cassandra.query import SimpleStatement
from tools.assertions import assert_invalid, assert_length_equal, assert_one
-from dtest import Tester, create_ks, create_cf
+from dtest import Tester, create_ks, create_cf, mk_bman_path
from tools.data import rows_to_list
since = pytest.mark.since
@@ -97,11 +97,11 @@ class TestCounters(Tester):
# Have node 1 and 3 cheat a bit during the leader election for a counter mutation; note that cheating
# takes place iff there is an actual chance for node 2 to be picked.
if cluster.version() < '4.0':
- nodes[0].update_startup_byteman_script('./byteman/pre4.0/election_counter_leader_favor_node2.btm')
- nodes[2].update_startup_byteman_script('./byteman/pre4.0/election_counter_leader_favor_node2.btm')
+ nodes[0].update_startup_byteman_script(mk_bman_path('pre4.0/election_counter_leader_favor_node2.btm'))
+ nodes[2].update_startup_byteman_script(mk_bman_path('pre4.0/election_counter_leader_favor_node2.btm'))
else:
- nodes[0].update_startup_byteman_script('./byteman/4.0/election_counter_leader_favor_node2.btm')
- nodes[2].update_startup_byteman_script('./byteman/4.0/election_counter_leader_favor_node2.btm')
+ nodes[0].update_startup_byteman_script(mk_bman_path('4.0/election_counter_leader_favor_node2.btm'))
+ nodes[2].update_startup_byteman_script(mk_bman_path('4.0/election_counter_leader_favor_node2.btm'))
cluster.start()
session = self.patient_cql_connection(nodes[0])
@@ -111,7 +111,7 @@ class TestCounters(Tester):
# Now stop the node and restart but first install a rule to slow down how fast node 2 will update the list
# nodes that are alive
nodes[1].stop(wait=True, wait_other_notice=False)
- nodes[1].update_startup_byteman_script('./byteman/gossip_alive_callback_sleep.btm')
+ nodes[1].update_startup_byteman_script(mk_bman_path('gossip_alive_callback_sleep.btm'))
nodes[1].start(no_wait=True, wait_other_notice=False)
# Until node 2 is fully alive try to force other nodes to pick him as mutation leader.
diff --git a/cql_test.py b/cql_test.py
index 2bec188..99d3088 100644
--- a/cql_test.py
+++ b/cql_test.py
@@ -12,7 +12,7 @@ from cassandra.metadata import NetworkTopologyStrategy, SimpleStrategy
from cassandra.policies import FallthroughRetryPolicy
from cassandra.query import SimpleStatement
-from dtest import Tester, create_ks
+from dtest import Tester, create_ks, mk_bman_path
from distutils.version import LooseVersion
from thrift_bindings.thrift010.ttypes import \
ConsistencyLevel as ThriftConsistencyLevel
@@ -775,7 +775,7 @@ class TestMiscellaneousCQL(CQLTester):
cluster = self.cluster
cluster.populate(3, install_byteman=True).start()
node1, _, node3 = cluster.nodelist()
- node3.byteman_submit(['./byteman/truncate_fail.btm'])
+ node3.byteman_submit([mk_bman_path('truncate_fail.btm')])
session = self.patient_exclusive_cql_connection(node1)
create_ks(session, 'ks', 3)
diff --git a/dtest.py b/dtest.py
index f2c89b2..01cf4f1 100644
--- a/dtest.py
+++ b/dtest.py
@@ -35,6 +35,8 @@ LAST_LOG = os.path.join(LOG_SAVED_DIR, "last")
LAST_TEST_DIR = 'last_test_dir'
+BYTEMAN_DIR = os.path.join(os.path.dirname(__file__), 'byteman')
+
DEFAULT_DIR = './'
config = configparser.RawConfigParser()
if len(config.read(os.path.expanduser('~/.cassandra-dtest'))) > 0:
@@ -66,6 +68,9 @@ def get_sha(repo_dir):
# git call failed for some unknown reason
raise
+def mk_bman_path(path):
+ return os.path.join(BYTEMAN_DIR, path)
+
# copy the initial environment variables so we can reset them later:
initial_environment = copy.deepcopy(os.environ)
diff --git a/materialized_views_test.py b/materialized_views_test.py
index fe2fb91..9a23f1e 100644
--- a/materialized_views_test.py
+++ b/materialized_views_test.py
@@ -20,7 +20,7 @@ from cassandra.cluster import Cluster
from cassandra.query import SimpleStatement
from distutils.version import LooseVersion
-from dtest import Tester, get_ip_from_node, create_ks
+from dtest import Tester, get_ip_from_node, create_ks, mk_bman_path
from tools.assertions import (assert_all, assert_crc_check_chance_equal,
assert_invalid, assert_none, assert_one,
assert_unavailable)
@@ -978,7 +978,7 @@ class TestMaterializedViews(Tester):
# Rename a column with an injected byteman rule to kill the node after the first schema update
self.fixture_dtest_setup.allow_log_errors = True
script_version = '4x' if self.cluster.version() >= '4' else '3x'
- node.byteman_submit(['./byteman/merge_schema_failure_{}.btm'.format(script_version)])
+ node.byteman_submit([mk_bman_path('merge_schema_failure_{}.btm'.format(script_version))])
with pytest.raises(NoHostAvailable):
session.execute("ALTER TABLE users RENAME username TO user")
@@ -1088,11 +1088,11 @@ class TestMaterializedViews(Tester):
logger.debug("Avoid premature MV build finalization with byteman")
for node in self.cluster.nodelist():
if self.cluster.version() >= '4':
- node.byteman_submit(['./byteman/4.0/skip_view_build_finalization.btm'])
- node.byteman_submit(['./byteman/4.0/skip_view_build_task_finalization.btm'])
+ node.byteman_submit([mk_bman_path('4.0/skip_view_build_finalization.btm')])
+ node.byteman_submit([mk_bman_path('4.0/skip_view_build_task_finalization.btm')])
else:
- node.byteman_submit(['./byteman/pre4.0/skip_finish_view_build_status.btm'])
- node.byteman_submit(['./byteman/pre4.0/skip_view_build_update_distributed.btm'])
+ node.byteman_submit([mk_bman_path('pre4.0/skip_finish_view_build_status.btm')])
+ node.byteman_submit([mk_bman_path('pre4.0/skip_view_build_update_distributed.btm')])
session.execute("CREATE TABLE t (id int PRIMARY KEY, v int, v2 text, v3 decimal)")
@@ -1157,7 +1157,7 @@ class TestMaterializedViews(Tester):
logger.debug("Slowing down MV build with byteman")
for node in self.cluster.nodelist():
- node.byteman_submit(['./byteman/4.0/view_builder_task_sleep.btm'])
+ node.byteman_submit([mk_bman_path('4.0/view_builder_task_sleep.btm')])
logger.debug("Create a MV")
session.execute(("CREATE MATERIALIZED VIEW t_by_v AS SELECT * FROM t "
@@ -1206,7 +1206,7 @@ class TestMaterializedViews(Tester):
logger.debug("Slowing down MV build with byteman")
for node in nodes:
- node.byteman_submit(['./byteman/4.0/view_builder_task_sleep.btm'])
+ node.byteman_submit([mk_bman_path('4.0/view_builder_task_sleep.btm')])
logger.debug("Create a MV")
session.execute(("CREATE MATERIALIZED VIEW t_by_v AS SELECT * FROM t "
@@ -1265,7 +1265,7 @@ class TestMaterializedViews(Tester):
logger.debug("Slowing down MV build with byteman")
for node in nodes:
- node.byteman_submit(['./byteman/4.0/view_builder_task_sleep.btm'])
+ node.byteman_submit([mk_bman_path('4.0/view_builder_task_sleep.btm')])
logger.debug("Create a MV")
session.execute(("CREATE MATERIALIZED VIEW t_by_v AS SELECT * FROM t "
@@ -2507,7 +2507,7 @@ class TestMaterializedViews(Tester):
session.cluster.control_connection.wait_for_schema_agreement()
logger.debug('Make node1 fail {} view writes'.format(fail_phase))
- node1.byteman_submit(['./byteman/fail_{}_view_write.btm'.format(fail_phase)])
+ node1.byteman_submit([mk_bman_path('fail_{}_view_write.btm'.format(fail_phase))])
logger.debug('Write 1000 rows - all node1 writes should fail')
diff --git a/read_repair_test.py b/read_repair_test.py
index ee189d5..f58d9f5 100644
--- a/read_repair_test.py
+++ b/read_repair_test.py
@@ -12,7 +12,7 @@ from cassandra.query import SimpleStatement
from ccmlib.node import Node
from pytest import raises
-from dtest import Tester, create_ks
+from dtest import Tester, create_ks, mk_bman_path
from tools.assertions import assert_one
from tools.data import rows_to_list
from tools.jmxutils import JolokiaAgent, make_mbean
@@ -504,7 +504,7 @@ class TestSpeculativeReadRepair(Tester):
'write_request_timeout_in_ms': 1000,
'read_request_timeout_in_ms': 1000})
cluster.populate(3, install_byteman=True, debug=True)
- byteman_validate(cluster.nodelist()[0], './byteman/read_repair/sorted_live_endpoints.btm', verbose=True)
+ byteman_validate(cluster.nodelist()[0], mk_bman_path('read_repair/sorted_live_endpoints.btm'), verbose=True)
cluster.start(jvm_args=['-XX:-PerfDisableSharedMem'])
session = fixture_dtest_setup.patient_exclusive_cql_connection(cluster.nodelist()[0], timeout=2)
@@ -527,15 +527,15 @@ class TestSpeculativeReadRepair(Tester):
session = self.get_cql_connection(node1, timeout=2)
session.execute(quorum("INSERT INTO ks.tbl (k, c, v) VALUES (1, 0, 1)"))
- node2.byteman_submit(['./byteman/read_repair/stop_writes.btm'])
- node3.byteman_submit(['./byteman/read_repair/stop_writes.btm'])
- node2.byteman_submit(['./byteman/read_repair/stop_rr_writes.btm'])
- node3.byteman_submit(['./byteman/read_repair/stop_rr_writes.btm'])
+ node2.byteman_submit([mk_bman_path('read_repair/stop_writes.btm')])
+ node3.byteman_submit([mk_bman_path('read_repair/stop_writes.btm')])
+ node2.byteman_submit([mk_bman_path('read_repair/stop_rr_writes.btm')])
+ node3.byteman_submit([mk_bman_path('read_repair/stop_rr_writes.btm')])
with raises(WriteTimeout):
session.execute(quorum("INSERT INTO ks.tbl (k, c, v) VALUES (1, 1, 2)"))
- node2.byteman_submit(['./byteman/read_repair/sorted_live_endpoints.btm'])
+ node2.byteman_submit([mk_bman_path('read_repair/sorted_live_endpoints.btm')])
session = self.get_cql_connection(node2)
with StorageProxy(node2) as storage_proxy:
assert storage_proxy.blocking_read_repair == 0
@@ -560,15 +560,15 @@ class TestSpeculativeReadRepair(Tester):
session.execute(quorum("INSERT INTO ks.tbl (k, c, v) VALUES (1, 0, 1)"))
- node2.byteman_submit(['./byteman/read_repair/stop_writes.btm'])
- node3.byteman_submit(['./byteman/read_repair/stop_writes.btm'])
+ node2.byteman_submit([mk_bman_path('read_repair/stop_writes.btm')])
+ node3.byteman_submit([mk_bman_path('read_repair/stop_writes.btm')])
session.execute("INSERT INTO ks.tbl (k, c, v) VALUES (1, 1, 2)")
# re-enable writes
- node2.byteman_submit(['-u', './byteman/read_repair/stop_writes.btm'])
+ node2.byteman_submit(['-u', mk_bman_path('read_repair/stop_writes.btm')])
- node2.byteman_submit(['./byteman/read_repair/sorted_live_endpoints.btm'])
+ node2.byteman_submit([mk_bman_path('read_repair/sorted_live_endpoints.btm')])
coordinator = node2
# Stop reads on coordinator in order to make sure we do not go through
# the messaging service for the local reads
@@ -597,20 +597,20 @@ class TestSpeculativeReadRepair(Tester):
session.execute(quorum("INSERT INTO ks.tbl (k, c, v) VALUES (1, 0, 1)"))
- node2.byteman_submit(['./byteman/read_repair/stop_writes.btm'])
- node3.byteman_submit(['./byteman/read_repair/stop_writes.btm'])
+ node2.byteman_submit([mk_bman_path('read_repair/stop_writes.btm')])
+ node3.byteman_submit([mk_bman_path('read_repair/stop_writes.btm')])
session.execute("INSERT INTO ks.tbl (k, c, v) VALUES (1, 1, 2)")
# re-enable writes
- node2.byteman_submit(['-u', './byteman/read_repair/stop_writes.btm'])
+ node2.byteman_submit(['-u', mk_bman_path('read_repair/stop_writes.btm')])
- node1.byteman_submit(['./byteman/read_repair/sorted_live_endpoints.btm'])
+ node1.byteman_submit([mk_bman_path('read_repair/sorted_live_endpoints.btm')])
version = self.cluster.cassandra_version()
if version < '4.1':
- node1.byteman_submit(['./byteman/request_verb_timing.btm'])
+ node1.byteman_submit([mk_bman_path('request_verb_timing.btm')])
else:
- node1.byteman_submit(['./byteman/post4.0/request_verb_timing.btm'])
+ node1.byteman_submit([mk_bman_path('post4.0/request_verb_timing.btm')])
with StorageProxy(node1) as storage_proxy:
assert storage_proxy.blocking_read_repair == 0
@@ -618,7 +618,7 @@ class TestSpeculativeReadRepair(Tester):
assert storage_proxy.speculated_rr_write == 0
session = self.get_cql_connection(node1)
- node2.byteman_submit(['./byteman/read_repair/stop_data_reads.btm'])
+ node2.byteman_submit([mk_bman_path('read_repair/stop_data_reads.btm')])
results = session.execute(quorum("SELECT * FROM ks.tbl WHERE k=1"))
timing = request_verb_timing(node1)
@@ -646,15 +646,15 @@ class TestSpeculativeReadRepair(Tester):
session.execute(quorum("INSERT INTO ks.tbl (k, c, v) VALUES (1, 0, 1)"))
- node2.byteman_submit(['./byteman/read_repair/stop_writes.btm'])
- node3.byteman_submit(['./byteman/read_repair/stop_writes.btm'])
+ node2.byteman_submit([mk_bman_path('read_repair/stop_writes.btm')])
+ node3.byteman_submit([mk_bman_path('read_repair/stop_writes.btm')])
session.execute("INSERT INTO ks.tbl (k, c, v) VALUES (1, 1, 2)")
# re-enable writes on node 3, leave them off on node2
- node2.byteman_submit(['./byteman/read_repair/stop_rr_writes.btm'])
+ node2.byteman_submit([mk_bman_path('read_repair/stop_rr_writes.btm')])
- node1.byteman_submit(['./byteman/read_repair/sorted_live_endpoints.btm'])
+ node1.byteman_submit([mk_bman_path('read_repair/sorted_live_endpoints.btm')])
with StorageProxy(node1) as storage_proxy:
assert storage_proxy.blocking_read_repair == 0
assert storage_proxy.speculated_rr_read == 0
@@ -682,21 +682,21 @@ class TestSpeculativeReadRepair(Tester):
session.execute(quorum("INSERT INTO ks.tbl (k, c, v) VALUES (1, 0, 1)"))
- node2.byteman_submit(['./byteman/read_repair/stop_writes.btm'])
- node3.byteman_submit(['./byteman/read_repair/stop_writes.btm'])
+ node2.byteman_submit([mk_bman_path('read_repair/stop_writes.btm')])
+ node3.byteman_submit([mk_bman_path('read_repair/stop_writes.btm')])
session.execute("INSERT INTO ks.tbl (k, c, v) VALUES (1, 1, 2)")
# re-enable writes
- node2.byteman_submit(['-u', './byteman/read_repair/stop_writes.btm'])
- node3.byteman_submit(['-u', './byteman/read_repair/stop_writes.btm'])
+ node2.byteman_submit(['-u', mk_bman_path('read_repair/stop_writes.btm')])
+ node3.byteman_submit(['-u', mk_bman_path('read_repair/stop_writes.btm')])
# force endpoint order
- node1.byteman_submit(['./byteman/read_repair/sorted_live_endpoints.btm'])
+ node1.byteman_submit([mk_bman_path('read_repair/sorted_live_endpoints.btm')])
- # node2.byteman_submit(['./byteman/read_repair/stop_digest_reads.btm'])
- node2.byteman_submit(['./byteman/read_repair/stop_data_reads.btm'])
- node3.byteman_submit(['./byteman/read_repair/stop_rr_writes.btm'])
+ # node2.byteman_submit([mk_bman_path('read_repair/stop_digest_reads.btm'])
+ node2.byteman_submit([mk_bman_path('read_repair/stop_data_reads.btm')])
+ node3.byteman_submit([mk_bman_path('read_repair/stop_rr_writes.btm')])
with StorageProxy(node1) as storage_proxy:
assert storage_proxy.get_table_metric("ks", "tbl", "SpeculativeRetries") == 0
@@ -727,21 +727,21 @@ class TestSpeculativeReadRepair(Tester):
session.execute(quorum("INSERT INTO ks.tbl (k, c, v) VALUES (1, 0, 1)"))
- node2.byteman_submit(['./byteman/read_repair/stop_writes.btm'])
- node3.byteman_submit(['./byteman/read_repair/stop_writes.btm'])
+ node2.byteman_submit([mk_bman_path('read_repair/stop_writes.btm')])
+ node3.byteman_submit([mk_bman_path('read_repair/stop_writes.btm')])
session.execute("INSERT INTO ks.tbl (k, c, v) VALUES (1, 1, 2)")
# re-enable writes
- node2.byteman_submit(['-u', './byteman/read_repair/stop_writes.btm'])
- node3.byteman_submit(['-u', './byteman/read_repair/stop_writes.btm'])
+ node2.byteman_submit(['-u', mk_bman_path('read_repair/stop_writes.btm')])
+ node3.byteman_submit(['-u', mk_bman_path('read_repair/stop_writes.btm')])
# force endpoint order
- node1.byteman_submit(['./byteman/read_repair/sorted_live_endpoints.btm'])
+ node1.byteman_submit([mk_bman_path('read_repair/sorted_live_endpoints.btm')])
- node2.byteman_submit(['./byteman/read_repair/stop_digest_reads.btm'])
- node3.byteman_submit(['./byteman/read_repair/stop_data_reads.btm'])
- node2.byteman_submit(['./byteman/read_repair/stop_rr_writes.btm'])
+ node2.byteman_submit([mk_bman_path('read_repair/stop_digest_reads.btm')])
+ node3.byteman_submit([mk_bman_path('read_repair/stop_data_reads.btm')])
+ node2.byteman_submit([mk_bman_path('read_repair/stop_rr_writes.btm')])
with StorageProxy(node1) as storage_proxy:
assert storage_proxy.get_table_metric("ks", "tbl", "SpeculativeRetries") == 0
@@ -762,7 +762,7 @@ class TestSpeculativeReadRepair(Tester):
@contextmanager
def _byteman_cycle(nodes, scripts):
- script_path = lambda name: './byteman/read_repair/' + name + '.btm'
+ script_path = lambda name: mk_bman_path('read_repair/') + name + '.btm'
for script in scripts:
byteman_validate(nodes[0], script_path(script))
diff --git a/rebuild_test.py b/rebuild_test.py
index 3fe8200..6851467 100644
--- a/rebuild_test.py
+++ b/rebuild_test.py
@@ -9,7 +9,7 @@ from threading import Thread
from cassandra import ConsistencyLevel
from ccmlib.node import ToolError
-from dtest import Tester, create_ks, create_cf
+from dtest import Tester, create_ks, create_cf, mk_bman_path
from tools.data import insert_c1c2, query_c1c2
since = pytest.mark.since
@@ -211,9 +211,9 @@ class TestRebuild(Tester):
# Path to byteman script which makes the streaming to node2 throw an exception, making rebuild fail
if cluster.version() < '4.0':
- script = ['./byteman/pre4.0/inject_failure_streaming_to_node2.btm']
+ script = [mk_bman_path('pre4.0/inject_failure_streaming_to_node2.btm')]
else:
- script = ['./byteman/4.0/inject_failure_streaming_to_node2.btm']
+ script = [mk_bman_path('4.0/inject_failure_streaming_to_node2.btm')]
node3.byteman_submit(script)
# First rebuild must fail and data must be incomplete
diff --git a/repair_tests/repair_test.py b/repair_tests/repair_test.py
index bad9550..c1bd71e 100644
--- a/repair_tests/repair_test.py
+++ b/repair_tests/repair_test.py
@@ -13,7 +13,7 @@ from cassandra import ConsistencyLevel
from cassandra.query import SimpleStatement
from ccmlib.node import ToolError
-from dtest import FlakyRetryPolicy, Tester, create_ks, create_cf
+from dtest import FlakyRetryPolicy, Tester, create_ks, create_cf, mk_bman_path
from tools.data import insert_c1c2, query_c1c2
from tools.jmxutils import JolokiaAgent, make_mbean
from repair_tests.incremental_repair_test import assert_parent_repair_session_count
@@ -1287,7 +1287,7 @@ class TestRepair(BaseRepairTest):
logger.debug("Submitting byteman script to {}".format(node_to_kill.name))
# Sleep on anticompaction/stream so there will be time for node to be killed
- node_to_kill.byteman_submit(['./byteman/{}'.format(script)])
+ node_to_kill.byteman_submit([mk_bman_path(script)])
def node1_repair():
global nodetool_error
diff --git a/replace_address_test.py b/replace_address_test.py
index c0e50f3..09b0e18 100644
--- a/replace_address_test.py
+++ b/replace_address_test.py
@@ -13,7 +13,7 @@ from cassandra import ConsistencyLevel, ReadTimeout, Unavailable
from cassandra.query import SimpleStatement
from ccmlib.node import Node
-from dtest import Tester
+from dtest import Tester, mk_bman_path
from tools.assertions import assert_bootstrap_state, assert_all, assert_not_running
from tools.data import rows_to_list
@@ -493,13 +493,13 @@ class TestReplaceAddress(BaseReplaceAddressTest):
btmmark = self.query_node.mark_log()
if self.cluster.version() < '4.0':
- self.query_node.byteman_submit(['./byteman/pre4.0/stream_failure.btm'])
+ self.query_node.byteman_submit([mk_bman_path('pre4.0/stream_failure.btm')])
self._do_replace(jvm_option='replace_address_first_boot',
opts={'streaming_socket_timeout_in_ms': 1000},
wait_for_binary_proto=False,
wait_other_notice=True)
else:
- self.query_node.byteman_submit(['./byteman/4.0/stream_failure.btm'])
+ self.query_node.byteman_submit([mk_bman_path('4.0/stream_failure.btm')])
self._do_replace(jvm_option='replace_address_first_boot', wait_for_binary_proto=False, wait_other_notice=True)
# Make sure bootstrap did not complete successfully
diff --git a/replica_side_filtering_test.py b/replica_side_filtering_test.py
index b33e401..4739ae3 100644
--- a/replica_side_filtering_test.py
+++ b/replica_side_filtering_test.py
@@ -4,7 +4,7 @@ import pytest
from cassandra import ConsistencyLevel as CL
from cassandra.query import SimpleStatement
-from dtest import Tester, create_ks
+from dtest import Tester, create_ks, mk_bman_path
from tools.assertions import (assert_all, assert_none, assert_one)
since = pytest.mark.since
@@ -542,7 +542,7 @@ class TestAllowFiltering(ReplicaSideFiltering):
# update the previous value with CL=ONE only in one replica
node = cluster.nodelist()[1 if missed_by_transient else 0]
- node.byteman_submit(['./byteman/stop_writes.btm'])
+ node.byteman_submit([mk_bman_path('stop_writes.btm')])
self.session.execute(SimpleStatement("UPDATE t SET v = 'new' WHERE k = 0", consistency_level=CL.ONE))
# query with CL=ALL to verify that no old values are resurrected
diff --git a/secondary_indexes_test.py b/secondary_indexes_test.py
index 5d73b0e..8007757 100644
--- a/secondary_indexes_test.py
+++ b/secondary_indexes_test.py
@@ -14,7 +14,7 @@ from cassandra.concurrent import (execute_concurrent,
from cassandra.protocol import ConfigurationException
from cassandra.query import BatchStatement, SimpleStatement
-from dtest import Tester, create_ks, create_cf
+from dtest import Tester, create_ks, create_cf, mk_bman_path
from tools.assertions import assert_bootstrap_state, assert_invalid, assert_none, assert_one, assert_row_count, \
assert_length_equal, assert_all
from tools.data import block_until_index_is_built, rows_to_list
@@ -353,7 +353,7 @@ class TestSecondaryIndexes(Tester):
# Simulate a failing index rebuild
before_files = self._index_sstables_files(node, 'k', 't', 'idx')
mark = node.mark_log()
- node.byteman_submit(['./byteman/index_build_failure.btm'])
+ node.byteman_submit([mk_bman_path('index_build_failure.btm')])
with pytest.raises(Exception):
node.nodetool("rebuild_index k t idx")
after_files = self._index_sstables_files(node, 'k', 't', 'idx')
@@ -387,7 +387,7 @@ class TestSecondaryIndexes(Tester):
# Simulate another failing index rebuild
before_files = after_files
mark = node.mark_log()
- node.byteman_submit(['./byteman/index_build_failure.btm'])
+ node.byteman_submit([mk_bman_path('index_build_failure.btm')])
with pytest.raises(Exception):
node.nodetool("rebuild_index k t idx")
after_files = self._index_sstables_files(node, 'k', 't', 'idx')
@@ -1212,9 +1212,9 @@ class TestPreJoinCallback(Tester):
node1.start(wait_for_binary_proto=True)
if cluster.version() < '4.0':
- node1.byteman_submit(['./byteman/pre4.0/inject_failure_streaming_to_node2.btm'])
+ node1.byteman_submit([mk_bman_path('pre4.0/inject_failure_streaming_to_node2.btm')])
else:
- node1.byteman_submit(['./byteman/4.0/inject_failure_streaming_to_node2.btm'])
+ node1.byteman_submit([mk_bman_path('4.0/inject_failure_streaming_to_node2.btm')])
node2 = new_node(cluster)
diff --git a/sstable_generation_loading_test.py b/sstable_generation_loading_test.py
index 502aaf9..3bd4ca9 100644
--- a/sstable_generation_loading_test.py
+++ b/sstable_generation_loading_test.py
@@ -10,7 +10,7 @@ import logging
from ccmlib import common as ccmcommon
from ccmlib.node import ToolError
-from dtest import Tester, create_ks, create_cf, MAJOR_VERSION_4
+from dtest import Tester, create_ks, create_cf, mk_bman_path, MAJOR_VERSION_4
from tools.assertions import assert_all, assert_none, assert_one
since = pytest.mark.since
@@ -394,7 +394,7 @@ class TestSSTableGenerationAndLoading(BaseSStableLoaderTester):
assert_one(session, "SELECT * FROM k.t WHERE v = 8", [0, 2, 8])
# Load SSTables with a failure during index creation
- node.byteman_submit(['./byteman/index_build_failure.btm'])
+ node.byteman_submit([mk_bman_path('index_build_failure.btm')])
with pytest.raises(Exception):
self.load_sstables(cluster, node, 'k')
diff --git a/topology_test.py b/topology_test.py
index 10b73c9..ca9441b 100644
--- a/topology_test.py
+++ b/topology_test.py
@@ -8,7 +8,7 @@ from threading import Thread
from cassandra import ConsistencyLevel
from ccmlib.node import TimeoutError, ToolError
-from dtest import Tester, create_ks, create_cf
+from dtest import Tester, create_ks, create_cf, mk_bman_path
from tools.assertions import assert_almost_equal, assert_all, assert_none
from tools.data import insert_c1c2, query_c1c2
@@ -234,9 +234,9 @@ class TestTopology(Tester):
# Execute first rebuild, should fail
with pytest.raises(ToolError):
if cluster.version() >= '4.0':
- script = ['./byteman/4.0/decommission_failure_inject.btm']
+ script = [mk_bman_path('4.0/decommission_failure_inject.btm')]
else:
- script = ['./byteman/pre4.0/decommission_failure_inject.btm']
+ script = [mk_bman_path('pre4.0/decommission_failure_inject.btm')]
node2.byteman_submit(script)
node2.nodetool('decommission')
diff --git a/transient_replication_test.py b/transient_replication_test.py
index 87b798d..7c6c71a 100644
--- a/transient_replication_test.py
+++ b/transient_replication_test.py
@@ -9,7 +9,7 @@ from cassandra.query import SimpleStatement
from cassandra.protocol import ConfigurationException
from ccmlib.node import Node
-from dtest import Tester
+from dtest import Tester, mk_bman_path
from tools.jmxutils import JolokiaAgent, make_mbean
from tools.data import rows_to_list
from tools.assertions import (assert_all)
@@ -177,7 +177,7 @@ class TransientReplicationBase(Tester):
self.node1, self.node2, self.node3 = self.nodes
# Make sure digest is not attempted against the transient node
- self.node3.byteman_submit(['./byteman/throw_on_digest.btm'])
+ self.node3.byteman_submit([mk_bman_path('throw_on_digest.btm')])
def stream_entire_sstables(self):
return True
@@ -317,7 +317,7 @@ class TestTransientReplication(TransientReplicationBase):
with tm(self.node1) as tm1, tm(self.node2) as tm2, tm(self.node3) as tm3:
self.insert_row(1, 1, 1)
# Stop writes to the other full node
- self.node2.byteman_submit(['./byteman/stop_writes.btm'])
+ self.node2.byteman_submit([mk_bman_path('stop_writes.btm')])
self.insert_row(1, 2, 2)
# node1 should contain both rows
@@ -342,7 +342,7 @@ class TestTransientReplication(TransientReplicationBase):
tm = lambda n: self.table_metrics(n)
self.insert_row(1, 1, 1)
# Stop writes to the other full node
- self.node2.byteman_submit(['./byteman/stop_writes.btm'])
+ self.node2.byteman_submit([mk_bman_path('stop_writes.btm')])
self.insert_row(1, 2, 2)
# Stop reads from the node that will hold the second row
@@ -367,7 +367,7 @@ class TestTransientReplication(TransientReplicationBase):
self.insert_row(1, 2, 2)
# Stop writes to the other full node
- self.node2.byteman_submit(['./byteman/stop_writes.btm'])
+ self.node2.byteman_submit([mk_bman_path('stop_writes.btm')])
self.delete_row(1, 1, node = self.node1)
# Stop reads from the node that will hold the second row
@@ -397,7 +397,7 @@ class TestTransientReplication(TransientReplicationBase):
self.insert_row(1, 1, 1)
self.insert_row(1, 2, 2)
# Stop writes to the other full node
- self.node2.byteman_submit(['./byteman/stop_writes.btm'])
+ self.node2.byteman_submit([mk_bman_path('stop_writes.btm')])
self.delete_row(1, 2)
self.assert_local_rows(self.node3,
@@ -432,7 +432,7 @@ class TestTransientReplication(TransientReplicationBase):
def test_speculative_write(self):
""" if a full replica isn't responding, we should send the write to the transient replica """
session = self.exclusive_cql_connection(self.node1)
- self.node2.byteman_submit(['./byteman/slow_writes.btm'])
+ self.node2.byteman_submit([mk_bman_path('slow_writes.btm')])
self.insert_row(1, 1, 1, session=session)
self.assert_local_rows(self.node1, [[1,1,1]])
@@ -467,7 +467,7 @@ class TestTransientReplicationRepairStreamEntireSSTable(TransientReplicationBase
if use_lcs:
self.use_lcs()
- self.node2.byteman_submit(['./byteman/stop_writes.btm'])
+ self.node2.byteman_submit([mk_bman_path('stop_writes.btm')])
# self.insert_row(1)
tm = lambda n: self.table_metrics(n)
with tm(self.node1) as tm1, tm(self.node2) as tm2, tm(self.node3) as tm3:
@@ -601,7 +601,7 @@ class TestTransientReplicationSpeculativeQueries(TransientReplicationBase):
session.execute("ALTER TABLE %s.%s WITH speculative_retry = 'ALWAYS';" % (self.keyspace, self.table))
self.insert_row(1, 1, 1)
# Stop writes to the other full node
- self.node2.byteman_submit(['./byteman/stop_writes.btm'])
+ self.node2.byteman_submit([mk_bman_path('stop_writes.btm')])
self.insert_row(1, 2, 2)
for node in self.nodes:
@@ -618,7 +618,7 @@ class TestTransientReplicationSpeculativeQueries(TransientReplicationBase):
session.execute("ALTER TABLE %s.%s WITH speculative_retry = '99.99PERCENTILE';" % (self.keyspace, self.table))
self.insert_row(1, 1, 1)
# Stop writes to the other full node
- self.node2.byteman_submit(['./byteman/stop_writes.btm'])
+ self.node2.byteman_submit([mk_bman_path('stop_writes.btm')])
self.insert_row(1, 2, 2)
for node in self.nodes:
@@ -652,7 +652,7 @@ class TestMultipleTransientNodes(TransientReplicationBase):
tm = lambda n: self.table_metrics(n)
self.insert_row(1, 1, 1)
# Stop writes to the other full node
- self.node2.byteman_submit(['./byteman/stop_writes.btm'])
+ self.node2.byteman_submit([mk_bman_path('stop_writes.btm')])
self.insert_row(1, 2, 2)
self.assert_local_rows(self.node1,
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@cassandra.apache.org
For additional commands, e-mail: commits-help@cassandra.apache.org