Skip to content
Permalink
Browse files
python test failures caused by error checks not filtering JAVA_TOOL_O…
…PTIONS

patch by David Capwell; reviewed by Benjamin Lerer for CASSANDRA-16660
  • Loading branch information
dcapwell authored and David Capwell committed May 7, 2021
1 parent bfd6bed commit 155175cbbba068afdfd2cc4c97d1d659b3eeeff6
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
@@ -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):

@@ -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__)
@@ -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()
@@ -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:

0 comments on commit 155175c

Please sign in to comment.