Skip to content

Commit

Permalink
python test failures caused by error checks not filtering JAVA_TOOL_O…
Browse files Browse the repository at this point in the history
…PTIONS

patch by David Capwell; reviewed by Benjamin Lerer for CASSANDRA-16660
  • Loading branch information
dcapwell committed May 7, 2021
1 parent bfd6bed commit 155175c
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
7 changes: 5 additions & 2 deletions cqlsh_tests/test_cqlsh.py
Original file line number Diff line number Diff line change
Expand Up @@ -140,11 +140,14 @@ def test_pycodestyle_compliance(self):

logger.debug(cmds)

# 3.7 adds a text=True option which converts stdout/stderr to str type, until then
# when printing out need to convert in order to avoid assert failing as the type
# does not have an encoding
p = subprocess.Popen(cmds, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
stdout, stderr = p.communicate()

assert 0 == len(stdout), stdout
assert 0 == len(stderr), stderr
assert 0 == len(stdout), str(stdout)
assert 0 == len(stderr), str(stderr)

def test_simple_insert(self):

Expand Down
5 changes: 3 additions & 2 deletions gossip_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

from dtest import Tester
from tools.misc import new_node
from tools.assertions import assert_stderr_clean

since = pytest.mark.since
logger = logging.getLogger(__name__)
Expand Down Expand Up @@ -40,7 +41,7 @@ def test_assassination_of_unknown_node(self):

logger.debug("Assassinating unknown node 11.1.1.1")
out, err, _ = node1.nodetool("assassinate 11.1.1.1")
assert len(err.strip()) <= 0, "nodetool command failed: {}".format(err)
assert_stderr_clean(err)

logger.debug("Starting node {}".format(node3.address()))
node3.start()
Expand Down Expand Up @@ -70,7 +71,7 @@ def test_assassinate_valid_node(self):
assassination_target = non_seed_nodes[0]
logger.debug("Assassinating non-seed node {}".format(assassination_target.address()))
out, err, _ = node1.nodetool("assassinate {}".format(assassination_target.address()))
assert len(err.strip()) <= 0, "nodetool command failed: {}".format(err)
assert_stderr_clean(err)

logger.debug("Starting non-seed nodes")
for node in non_seed_nodes:
Expand Down

0 comments on commit 155175c

Please sign in to comment.