You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cassandra.apache.org by ma...@apache.org on 2018/03/22 09:41:00 UTC

[1/2] cassandra-dtest git commit: tools/jmxutils.py decode bytes to string before passing to json.loads

Repository: cassandra-dtest
Updated Branches:
  refs/heads/master 2c1b986bc -> 0b4f34a9a


tools/jmxutils.py decode bytes to string before passing to json.loads

Patch by Patrick Bannister; reviewed by marcuse for CASSANDRA-14320

Closes #21


Project: http://git-wip-us.apache.org/repos/asf/cassandra-dtest/repo
Commit: http://git-wip-us.apache.org/repos/asf/cassandra-dtest/commit/5057b827
Tree: http://git-wip-us.apache.org/repos/asf/cassandra-dtest/tree/5057b827
Diff: http://git-wip-us.apache.org/repos/asf/cassandra-dtest/diff/5057b827

Branch: refs/heads/master
Commit: 5057b8273cddfeff1788fd2861de4ac1c80369cf
Parents: 2c1b986
Author: Patrick Bannister <pt...@gmail.com>
Authored: Sat Mar 17 03:32:50 2018 +0000
Committer: Marcus Eriksson <ma...@apache.org>
Committed: Thu Mar 22 10:39:57 2018 +0100

----------------------------------------------------------------------
 tools/jmxutils.py | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cassandra-dtest/blob/5057b827/tools/jmxutils.py
----------------------------------------------------------------------
diff --git a/tools/jmxutils.py b/tools/jmxutils.py
index 83459e0..8c78022 100644
--- a/tools/jmxutils.py
+++ b/tools/jmxutils.py
@@ -22,7 +22,7 @@ def jolokia_classpath():
         return CLASSPATH_SEP.join((tools_jar, JOLOKIA_JAR))
     else:
         logger.warning("Environment variable $JAVA_HOME not present: jmx-based " +
-                "tests may fail because of missing $JAVA_HOME/lib/tools.jar.")
+                       "tests may fail because of missing $JAVA_HOME/lib/tools.jar.")
         return JOLOKIA_JAR
 
 
@@ -237,7 +237,7 @@ class JolokiaAgent(object):
             raise Exception("Failed to query Jolokia agent; HTTP response code: %d; response: %s" % (response.code, response.readlines()))
 
         raw_response = response.readline()
-        response = json.loads(raw_response)
+        response = json.loads(raw_response.decode(encoding='utf-8'))
         if response['status'] != 200:
             stacktrace = response.get('stacktrace')
             if stacktrace and verbose:


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@cassandra.apache.org
For additional commands, e-mail: commits-help@cassandra.apache.org


[2/2] cassandra-dtest git commit: more fixes to stop decoding strings

Posted by ma...@apache.org.
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 <pt...@gmail.com>
Authored: Wed Mar 21 20:15:45 2018 +0000
Committer: Marcus Eriksson <ma...@apache.org>
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: commits-unsubscribe@cassandra.apache.org
For additional commands, e-mail: commits-help@cassandra.apache.org