[ https://issues.apache.org/jira/browse/CASSANDRA-15012?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16783815#comment-16783815 ]
Joseph Lynch commented on CASSANDRA-15012: ------------------------------------------ Correct, I believe that it was removed in CASSANDRA-5261 which was merged in 3.0 in [db7feb4c2|https://github.com/apache/cassandra/commit/db7feb4c2]. > token_generator_test.TestTokenGenerator test fails on 2.2 > --------------------------------------------------------- > > Key: CASSANDRA-15012 > URL: https://issues.apache.org/jira/browse/CASSANDRA-15012 > Project: Cassandra > Issue Type: Improvement > Components: Test/dtest > Reporter: Joseph Lynch > Assignee: Joseph Lynch > Priority: Minor > Labels: beginner, dtest, test > Fix For: 2.2.x > > Attachments: --graph output.png, test-output.png > > > While running tests for the 2.2.14 candidate I noticed that the > {{TestTokenGenerator}} dtests are broken. I reproduced locally as well, the > issue appears to be that we're running a python2 script with python3 (since > dtests run python3 now). > Should be a quick fix to make the token generator script py2/3 compatible. > Example local run: > {noformat} > pytest --cassandra-dir=/home/josephl/pg/cassandra_2 -k TestTokenGenerator > > 1 ↵ > =============================================================================================================== > test session starts > ================================================================================================================ > platform linux -- Python 3.6.7, pytest-3.6.4, py-1.7.0, pluggy-0.7.1 > rootdir: /home/josephl/pg/cassandra-dtest, inifile: pytest.ini > plugins: timeout-1.3.3, flaky-3.4.0 > timeout: 900.0s > timeout method: signal > timeout func_only: False > collected 1028 items / 1025 deselected > > > > token_generator_test.py FFF > > > [100%] > ===================================================================================================================== > FAILURES > ===================================================================================================================== > _________________________________________________________________________________________________ > TestTokenGenerator.test_multi_dc_tokens_default > __________________________________________________________________________________________________ > self = <token_generator_test.TestTokenGenerator object at 0x7f5188c7cdd8> > def test_multi_dc_tokens_default(self): > > self._multi_dc_tokens() > token_generator_test.py:167: > _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ > _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ > _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ > _ _ _ _ _ > token_generator_test.py:153: in _multi_dc_tokens > generated_tokens = > self.call_token_generator(self.cluster.get_install_dir(), random, dc_nodes) > token_generator_test.py:43: in call_token_generator > token_gen_output = subprocess.check_output(args) > /usr/lib/python3.6/subprocess.py:336: in check_output > **kwargs).stdout > _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ > _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ > _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ > _ _ _ _ _ > input = None, timeout = None, check = True, popenargs = > (['/home/josephl/pg/cassandra_2/tools/bin/token-generator', '3', '5'],), > kwargs = {'stdout': -1}, process = <subprocess.Popen object at > 0x7f5188b80208>, stdout = b'', stderr = None > retcode = 1 > def run(*popenargs, input=None, timeout=None, check=False, **kwargs): > """Run command with arguments and return a CompletedProcess instance. > > The returned instance will have attributes args, returncode, stdout > and > stderr. By default, stdout and stderr are not captured, and those > attributes > will be None. Pass stdout=PIPE and/or stderr=PIPE in order to capture > them. > > If check is True and the exit code was non-zero, it raises a > CalledProcessError. The CalledProcessError object will have the > return code > in the returncode attribute, and output & stderr attributes if those > streams > were captured. > > If timeout is given, and the process takes too long, a TimeoutExpired > exception will be raised. > > There is an optional argument "input", allowing you to > pass a string to the subprocess's stdin. If you use this argument > you may not also use the Popen constructor's "stdin" argument, as > it will be used internally. > > The other arguments are the same as for the Popen constructor. > > If universal_newlines=True is passed, the "input" argument must be a > string and stdout/stderr in the returned object will be strings > rather than > bytes. > """ > if input is not None: > if 'stdin' in kwargs: > raise ValueError('stdin and input arguments may not both be > used.') > kwargs['stdin'] = PIPE > > with Popen(*popenargs, **kwargs) as process: > try: > stdout, stderr = process.communicate(input, timeout=timeout) > except TimeoutExpired: > process.kill() > stdout, stderr = process.communicate() > raise TimeoutExpired(process.args, timeout, output=stdout, > stderr=stderr) > except: > process.kill() > process.wait() > raise > retcode = process.poll() > if check and retcode: > raise CalledProcessError(retcode, process.args, > > output=stdout, stderr=stderr) > E subprocess.CalledProcessError: Command > '['/home/josephl/pg/cassandra_2/tools/bin/token-generator', '3', '5']' > returned non-zero exit status 1. > /usr/lib/python3.6/subprocess.py:418: CalledProcessError > -------------------------------------------------------------------------------------------------------------- > Captured stdout setup > --------------------------------------------------------------------------------------------------------------- > 10:03:31,457 ccm DEBUG Log-watching thread starting. > ---------------------------------------------------------------------------------------------------------------- > Captured log setup > ---------------------------------------------------------------------------------------------------------------- > 10:03:31,425 conftest INFO Starting execution of test_multi_dc_tokens_default > at 2019-02-05 10:03:31.425612 > 10:03:31,426 dtest_setup INFO cluster ccm directory: /tmp/dtest-89rd87ne > --------------------------------------------------------------------------------------------------------------- > Captured stderr call > --------------------------------------------------------------------------------------------------------------- > File "/home/josephl/pg/cassandra_2/tools/bin/token-generator", line 160 > print "%sDC #%d:" % (indentstr, dcnum + 1) > ^ > SyntaxError: invalid syntax > ------------------------------------------------------------------------------------------------------------- > Captured stdout teardown > ------------------------------------------------------------------------------------------------------------- > 10:03:31,708 ccm DEBUG Log-watching thread exiting. > ... > ... > ... > {noformat} -- This message was sent by Atlassian JIRA (v7.6.3#76005) --------------------------------------------------------------------- To unsubscribe, e-mail: commits-unsubscr...@cassandra.apache.org For additional commands, e-mail: commits-h...@cassandra.apache.org