more fixes to stop decoding strings Patch by Patrick Bannister; reviewed by marcuse for CASSANDRA-14334
Project: http://git-wip-us.apache.org/repos/asf/cassandra-dtest/repo Commit: http://git-wip-us.apache.org/repos/asf/cassandra-dtest/commit/0b4f34a9 Tree: http://git-wip-us.apache.org/repos/asf/cassandra-dtest/tree/0b4f34a9 Diff: http://git-wip-us.apache.org/repos/asf/cassandra-dtest/diff/0b4f34a9 Branch: refs/heads/master Commit: 0b4f34a9af3e800d7cdbb432de3aac1e0c524c2d Parents: 5057b82 Author: Patrick Bannister <[email protected]> Authored: Wed Mar 21 20:15:45 2018 +0000 Committer: Marcus Eriksson <[email protected]> Committed: Thu Mar 22 10:40:24 2018 +0100 ---------------------------------------------------------------------- repair_tests/repair_test.py | 8 +++++--- sstablesplit_test.py | 4 ++-- 2 files changed, 7 insertions(+), 5 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/cassandra-dtest/blob/0b4f34a9/repair_tests/repair_test.py ---------------------------------------------------------------------- diff --git a/repair_tests/repair_test.py b/repair_tests/repair_test.py index 53ab2af..66189cf 100644 --- a/repair_tests/repair_test.py +++ b/repair_tests/repair_test.py @@ -278,7 +278,7 @@ class TestRepair(BaseRepairTest): out = node.run_sstablemetadata(keyspace=keyspace).stdout def matches(pattern): - return [_f for _f in [pattern.match(l) for l in out.decode("utf-8").split('\n')] if _f] + return [_f for _f in [pattern.match(l) for l in out.split('\n')] if _f] names = [m.group(1) for m in matches(_sstable_name)] repaired_times = [int(m.group(1)) for m in matches(_repaired_at)] @@ -650,7 +650,7 @@ class TestRepair(BaseRepairTest): for line, m in out_of_sync_logs: num_out_of_sync_ranges, out_of_sync_nodes = m.group(3), {m.group(1), m.group(2)} - assert int(num_out_of_sync_ranges) == 1, "Expecting 1 range out of sync for {}, but saw {}".format(out_of_sync_nodes , num_out_of_sync_ranges) + assert int(num_out_of_sync_ranges) == 1, "Expecting 1 range out of sync for {}, but saw {}".format(out_of_sync_nodes, num_out_of_sync_ranges) assert out_of_sync_nodes, valid_out_of_sync_pairs in str(out_of_sync_nodes) # Check node2 now has the key @@ -1090,6 +1090,7 @@ class TestRepair(BaseRepairTest): cluster.populate(3).start(wait_for_binary_proto=True) node1, node2, node3 = cluster.nodelist() node1.stress(['write', 'n=100k', '-schema', 'replication(factor=3)', '-rate', 'threads=30']) + def run_repair(): try: if cluster.version() >= "2.2": @@ -1097,7 +1098,8 @@ class TestRepair(BaseRepairTest): else: node1.nodetool('repair keyspace1 standard1 -inc -par') except ToolError: - debug("got expected exception during repair, ignoring") + logger.debug("got expected exception during repair, ignoring") + t1 = threading.Thread(target=run_repair) t1.start() if cluster.version() > "2.2": http://git-wip-us.apache.org/repos/asf/cassandra-dtest/blob/0b4f34a9/sstablesplit_test.py ---------------------------------------------------------------------- diff --git a/sstablesplit_test.py b/sstablesplit_test.py index 382f618..4d86195 100644 --- a/sstablesplit_test.py +++ b/sstablesplit_test.py @@ -103,8 +103,8 @@ class TestSSTableSplit(Tester): result = node.run_sstablesplit(keyspace='keyspace1', size=1, no_snapshot=True) for (stdout, stderr, rc) in result: - logger.debug(stderr.decode("utf-8")) - failure = stderr.decode("utf-8").find("java.lang.AssertionError: Data component is missing") + logger.debug(stderr) + failure = stderr.find("java.lang.AssertionError: Data component is missing") assert failure, -1 == "Error during sstablesplit" sstables = node.get_sstables('keyspace1', '') --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
