This is an automated email from the ASF dual-hosted git repository.

dcapwell pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/cassandra-dtest.git


The following commit(s) were added to refs/heads/master by this push:
     new 53cb98d  When running python dtest and using JAVA_TOOL_OPTIONS to 
inject cassandra configurations, tests fail as they don't expect this flag in 
stderr
53cb98d is described below

commit 53cb98dc67bf9887898032a3423d667ce57a7b77
Author: David Capwell <dcapw...@gmail.com>
AuthorDate: Wed Oct 21 12:46:26 2020 -0700

    When running python dtest and using JAVA_TOOL_OPTIONS to inject cassandra 
configurations, tests fail as they don't expect this flag in stderr
    
    patch by David Capwell; reviewed by Jordan West for CASSANDRA-16219
---
 hintedhandoff_test.py |  3 ++-
 nodetool_test.py      | 22 +++++++++++-----------
 offline_tools_test.py |  7 ++++++-
 snitch_test.py        |  3 ++-
 4 files changed, 21 insertions(+), 14 deletions(-)

diff --git a/hintedhandoff_test.py b/hintedhandoff_test.py
index dc5d64c..0d2d6e8 100644
--- a/hintedhandoff_test.py
+++ b/hintedhandoff_test.py
@@ -7,6 +7,7 @@ from cassandra import ConsistencyLevel
 
 from dtest import Tester, create_ks
 from tools.data import create_c1c2_table, insert_c1c2, query_c1c2
+from tools.assertions import assert_stderr_clean
 
 since = pytest.mark.since
 logger = logging.getLogger(__name__)
@@ -43,7 +44,7 @@ class TestHintedHandoffConfig(Tester):
         Launch a nodetool command and check there is no error, return the 
result
         """
         out, err, _ = node.nodetool(cmd)
-        assert '' == err
+        assert_stderr_clean(err)
         return out
 
     def _do_hinted_handoff(self, node1, node2, enabled, keyspace='ks'):
diff --git a/nodetool_test.py b/nodetool_test.py
index 09e1dff..800181c 100644
--- a/nodetool_test.py
+++ b/nodetool_test.py
@@ -8,7 +8,7 @@ from cassandra.query import SimpleStatement
 from ccmlib.node import ToolError
 
 from dtest import Tester, create_ks
-from tools.assertions import assert_all, assert_invalid, assert_none
+from tools.assertions import assert_all, assert_invalid, assert_none, 
assert_stderr_clean
 from tools.jmxutils import JolokiaAgent, make_mbean
 
 since = pytest.mark.since
@@ -35,7 +35,7 @@ class TestNodetool(Tester):
             node.decommission()
             assert not "Expected nodetool error"
         except ToolError as e:
-            assert '' == e.stderr
+            assert_stderr_clean(e.stderr)
             assert 'Unsupported operation' in e.stdout
 
     def test_correct_dc_rack_in_nodetool_info(self):
@@ -58,7 +58,7 @@ class TestNodetool(Tester):
 
         for i, node in enumerate(cluster.nodelist()):
             out, err, _ = node.nodetool('info')
-            assert 0 == len(err), err
+            assert_stderr_clean(err)
             out_str = out
             if isinstance(out, (bytes, bytearray)):
                 out_str = out.decode("utf-8")
@@ -91,19 +91,19 @@ class TestNodetool(Tester):
         # read all of the timeouts, make sure we get a sane response
         for timeout_type in types:
             out, err, _ = node.nodetool('gettimeout {}'.format(timeout_type))
-            assert 0 == len(err), err
+            assert_stderr_clean(err)
             logger.debug(out)
             assert re.search(r'.* \d+ ms', out)
 
         # set all of the timeouts to 123
         for timeout_type in types:
             _, err, _ = node.nodetool('settimeout {} 123'.format(timeout_type))
-            assert 0 == len(err), err
+            assert_stderr_clean(err)
 
         # verify that they're all reported as 123
         for timeout_type in types:
             out, err, _ = node.nodetool('gettimeout {}'.format(timeout_type))
-            assert 0 == len(err), err
+            assert_stderr_clean(err)
             logger.debug(out)
             assert re.search(r'.* 123 ms', out)
 
@@ -197,7 +197,7 @@ class TestNodetool(Tester):
 
         # Do a first try without any keypace, we shouldn't have the notice
         out, err, _ = node.nodetool('status')
-        assert 0 == len(err), err
+        assert_stderr_clean(err)
         assert not re.search(notice_message, out)
 
         session = self.patient_cql_connection(node)
@@ -205,21 +205,21 @@ class TestNodetool(Tester):
 
         # With 1 keyspace, we should still not get the notice
         out, err, _ = node.nodetool('status')
-        assert 0 == len(err), err
+        assert_stderr_clean(err)
         assert not re.search(notice_message, out)
 
         session.execute("CREATE KEYSPACE ks2 WITH replication = { 
'class':'SimpleStrategy', 'replication_factor':1}")
 
         # With 2 keyspaces with the same settings, we should not get the notice
         out, err, _ = node.nodetool('status')
-        assert 0 == len(err), err
+        assert_stderr_clean(err)
         assert not re.search(notice_message, out)
 
         session.execute("CREATE KEYSPACE ks3 WITH replication = { 
'class':'SimpleStrategy', 'replication_factor':3}")
 
         # With a keyspace without the same replication factor, we should get 
the notice
         out, err, _ = node.nodetool('status')
-        assert 0 == len(err), err
+        assert_stderr_clean(err)
         assert re.search(notice_message, out)
 
     @since('4.0')
@@ -440,7 +440,7 @@ class TestNodetool(Tester):
 
     def _describe(self, node):
         node_describe, err, _ = node.nodetool('describecluster')
-        assert 0 == len(err), err
+        assert_stderr_clean(err)
         out_sorted = node_describe.split()
         out_sorted.sort()
         return (node_describe, out_sorted)
diff --git a/offline_tools_test.py b/offline_tools_test.py
index 725cc65..8f6f98d 100644
--- a/offline_tools_test.py
+++ b/offline_tools_test.py
@@ -8,6 +8,7 @@ import logging
 
 from ccmlib import common
 from ccmlib.node import ToolError
+from tools.assertions import assert_stderr_clean
 
 from dtest import Tester, create_ks
 
@@ -445,7 +446,11 @@ class TestOfflineTools(Tester):
         assert {'1', '2'} == dumped_keys
 
     def _check_stderr_error(self, error):
-        acceptable = ["Max sstable size of", "Consider adding more capacity", 
"JNA link failure", "Class JavaLaunchHelper is implemented in both"]
+        acceptable = ["Max sstable size of",
+                "Consider adding more capacity",
+                "JNA link failure",
+                "Class JavaLaunchHelper is implemented in both",
+                "Picked up JAVA_TOOL_OPTIONS:"]
 
         if len(error) > 0:
             for line in error.splitlines():
diff --git a/snitch_test.py b/snitch_test.py
index 7c08d0e..c6d5028 100644
--- a/snitch_test.py
+++ b/snitch_test.py
@@ -6,6 +6,7 @@ import logging
 
 from cassandra import ConsistencyLevel
 from dtest import Tester
+from tools.assertions import assert_stderr_clean
 from tools.jmxutils import (JolokiaAgent, make_mbean)
 
 since = pytest.mark.since
@@ -122,7 +123,7 @@ class TestGossipingPropertyFileSnitch(Tester):
         assert original_rows == new_rows
 
         out, err, _ = node1.nodetool('gossipinfo')
-        assert 0 == len(err), err
+        assert_stderr_clean(err)
         logger.debug(out)
 
         assert "/{}".format(NODE1_BROADCAST_ADDRESS) in out


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

Reply via email to