[ 
https://issues.apache.org/jira/browse/CASSANDRA-14371?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16431620#comment-16431620
 ] 

Patrick Bannister commented on CASSANDRA-14371:
-----------------------------------------------

OK, the root cause of this test failure is that CASSANDRA-14334 did not fix the 
problem completely. Details below, but short version is that ccm returns stdout 
and stderr for nodetool commands as a string if there's anything on the stream, 
or as a bytes if they're empty.

In the event that a process returns no errors, it returns an empty bytes object 
for stderr. ccm's ccmlib/node.py only decodes stderr if it evaluates to True 
and it's a bytes object. (The same is true for stdout.) An empty bytes object 
evaluates as False, so most likely, what happened is that nodetool sstablesplit 
returned no errors, hence ccm returned it as an empty bytes (b''), then 
cassandra-dtest's sstablesplit_test.py::test_single_file_split calls the empty 
bytes object's .find() method with a string argument, resulting in the 
TypeError in the test run.

The best solution here is to get ccm to consistently return a string from 
handle_external_tool_process in ccmlib/node.py. I'll look into that.

As an intermediate solution, I could reopen CASSANDRA-14334 and we could 
conditionally decode stdout and stderr if they're bytes instances, in all the 
affected places.

> dtest failure: sstablesplit_test.TestSSTableSplit.test_single_file_split
> ------------------------------------------------------------------------
>
>                 Key: CASSANDRA-14371
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-14371
>             Project: Cassandra
>          Issue Type: Improvement
>            Reporter: Marcus Eriksson
>            Priority: Major
>
> https://builds.apache.org/view/A-D/view/Cassandra/job/Cassandra-trunk-dtest/489/testReport/sstablesplit_test/TestSSTableSplit/test_single_file_split/
> {code}
>         for (stdout, stderr, rc) in result:
>             logger.debug(stderr)
> >           failure = stderr.find("java.lang.AssertionError: Data component 
> > is missing")
> E           TypeError: a bytes-like object is required, not 'str'
> {code}



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to