Unit Test Results.

Designed for use with JUnit and Ant.

All Failures

ClassNameStatusTypeTime(s)
8_cythonno_x86_64_15_64test_decommissioned_node_cant_rejoinFailureccmlib.node.TimeoutError: timed out and did not find log entry: This node was decommissioned and will not rejoin the ring

self = <topology_test.TestTopology object at 0x7fe3beec9100>

@since('3.0')
def test_decommissioned_node_cant_rejoin(self):
"""
@jira_ticket CASSANDRA-8801

Test that a decommissioned node can't rejoin the cluster by:

- creating a cluster,
- decommissioning a node, and
- asserting that the "decommissioned node won't rejoin" error is in the
logs for that node and
- asserting that the node is not running.
"""
rejoin_err = 'This node was decommissioned and will not rejoin the ring'
self.fixture_dtest_setup.ignore_log_patterns = list(self.fixture_dtest_setup.ignore_log_patterns) + [
rejoin_err]

self.cluster.populate(3).start()
node1, node2, node3 = self.cluster.nodelist()

logger.debug('decommissioning...')
node3.decommission(force=self.cluster.version() >= '4.0')
logger.debug('stopping...')
node3.stop()
logger.debug('attempting restart...')
node3.start(wait_other_notice=False)
timedout = False
try:
# usually takes 3 seconds, so give it a generous 15
node3.watch_log_for(rejoin_err, timeout=15)
except TimeoutError:
# TimeoutError is not very helpful to the reader of the test output;
# let that pass and move on to string assertion below
timedout = True

n3errors = node3.grep_log_for_errors()
if len(n3errors) == 0 and timedout:
> raise TimeoutError("timed out and did not find log entry: " + rejoin_err)
E ccmlib.node.TimeoutError: timed out and did not find log entry: This node was decommissioned and will not rejoin the ring

topology_test.py:425: TimeoutError
126.582
8_cythonno_x86_64_23_64test_fail_when_seedFailureccmlib.node.TimeoutError: 27 Nov 2024 09:35:21 [node3] after 20.04/20 seconds Missing: ['Replacing a node without bootstrapping risks invalidating consistency guarantees'] not found in system.log: Head: INFO [main] 2024-11-27 09:35:07,028 YamlConfigura Tail: ...milliseconds INFO [main] 2024-11-27 09:35:16,576 MonotonicClock.java:351 - Scheduling approximate time-check task with a precision of 2 milliseconds

self = <replace_address_test.TestReplaceAddress object at 0x7f504e59cb50>

@since('3.0')
def test_fail_when_seed(self):
"""
When a node is a seed replace should fail
@jira_ticket CASSANDRA-14463
"""
self.fixture_dtest_setup.ignore_log_patterns = list(self.fixture_dtest_setup.ignore_log_patterns) + [
r'Couldn\'t find table with id 5bc52802-de25-35ed-aeab-188eecebb090', # system_auth
r'Exception encountered during startup',
r'Unknown endpoint'
]

# see CASSANDRA-17611
if self.cluster.version() < '4.0':
self.fixture_dtest_setup.ignore_log_patterns = list(self.fixture_dtest_setup.ignore_log_patterns) + [
r'RejectedExecutionException']

self._setup(n=3)
node1, node2, node3 = self.cluster.nodelist()
self.cluster.seeds.append(node3.address())

node3.stop(gently=False)
mark = node3.mark_log()

for d in chain([os.path.join(node3.get_path(), "commitlogs")],
[os.path.join(node3.get_path(), "saved_caches")],
node3.data_directories()):
if os.path.exists(d):
rmtree(d)

node3.start(jvm_args=["-Dcassandra.replace_address=" + node3.address()], wait_other_notice=False)
> node3.watch_log_for('Replacing a node without bootstrapping risks invalidating consistency guarantees', from_mark=mark, timeout=20)

replace_address_test.py:432:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
../cassandra/build/venv/lib/python3.8/site-packages/ccmlib/node.py:610: in watch_log_for
TimeoutError.raise_if_passed(start=start, timeout=timeout, node=self.name,
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

start = 1732700101.5288508, timeout = 20
msg = "Missing: ['Replacing a node without bootstrapping risks invalidating consistency guarantees'] not found in system.log...-27 09:35:16,576 MonotonicClock.java:351 - Scheduling approximate time-check task with a precision of 2 milliseconds\n"
node = 'node3'

@staticmethod
def raise_if_passed(start, timeout, msg, node=None):
if start + timeout < time.time():
> raise TimeoutError.create(start, timeout, msg, node)
E ccmlib.node.TimeoutError: 27 Nov 2024 09:35:21 [node3] after 20.04/20 seconds Missing: ['Replacing a node without bootstrapping risks invalidating consistency guarantees'] not found in system.log:
E Head: INFO [main] 2024-11-27 09:35:07,028 YamlConfigura
E Tail: ...milliseconds
E INFO [main] 2024-11-27 09:35:16,576 MonotonicClock.java:351 - Scheduling approximate time-check task with a precision of 2 milliseconds

../cassandra/build/venv/lib/python3.8/site-packages/ccmlib/node.py:56: TimeoutError
167.387
8_cythonno_x86_64_32_64test_dont_archive_commitlogFailureAssertionError: It's been over 180s and we haven't written a new commitlog segment. Something is wrong.

self = <snapshot_test.TestArchiveCommitlog object at 0x7faad0239af0>

def test_dont_archive_commitlog(self):
"""
Run the archive commitlog test, but forget to add the restore commands
"""
> self.run_archive_commitlog(restore_point_in_time=False, restore_archived_commitlog=False)

snapshot_test.py:255:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
snapshot_test.py:303: in run_archive_commitlog
advance_to_next_cl_segment(
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

session = <cassandra.cluster.Session object at 0x7faad0014190>
commitlog_dir = '/home/cassandra/cassandra/build/run-python-dtest.T3wZLX/dtest-tael4ce2/test/node1/commitlogs'
keyspace_name = 'ks', table_name = 'junk_table', timeout = 180

def advance_to_next_cl_segment(session, commitlog_dir,
keyspace_name='ks', table_name='junk_table',
timeout=180):
"""
This is a hack to work around problems like CASSANDRA-11811.

The problem happens in commitlog-replaying tests, like the snapshot and CDC
tests. If we replay the first commitlog that's created, we wind up
replaying some mutations that initialize system tables, so this function
advances the node to the next CL by filling up the first one.
"""
session.execute(
'CREATE TABLE {ks}.{tab} ('
'a uuid PRIMARY KEY, b uuid, c uuid, d uuid, '
'e uuid, f uuid, g uuid, h uuid'
')'.format(ks=keyspace_name, tab=table_name)
)
prepared_insert = session.prepare(
'INSERT INTO {ks}.{tab} '
'(a, b, c, d, e, f, g, h) '
'VALUES ('
'uuid(), uuid(), uuid(), uuid(), '
'uuid(), uuid(), uuid(), uuid()'
')'.format(ks=keyspace_name, tab=table_name)
)

# record segments that we want to advance past
initial_cl_files = _files_in(commitlog_dir)

start = time.time()
stop_time = start + timeout
rate_limited_debug_logger = get_rate_limited_function(logger.debug, 5)
logger.debug('attempting to write until we start writing to new CL segments: {}'.format(initial_cl_files))

while _files_in(commitlog_dir) <= initial_cl_files:
elapsed = time.time() - start
rate_limited_debug_logger(' commitlog-advancing load step has lasted {s:.2f}s'.format(s=elapsed))
> assert (
time.time() <= stop_time), ("It's been over {s}s and we haven't written a new " +
"commitlog segment. Something is wrong.").format(s=timeout)
E AssertionError: It's been over 180s and we haven't written a new commitlog segment. Something is wrong.

tools/hacks.py:59: AssertionError
241.782
8_cythonno_x86_64_32_64test_round_trip_with_rate_fileFailurecassandra.OperationTimedOut: errors={'127.0.0.1:9042': 'Client request timeout. See Session.execute[_async](timeout)'}, last_host=127.0.0.1:9042

self = <cqlsh_tests.test_cqlsh_copy.TestCqlshCopy object at 0x7faacfeff4f0>

def test_round_trip_with_rate_file(self):
"""
Test a round trip with a large number of rows and a rate file. Make sure the rate file contains
output statistics

@jira_ticket CASSANDRA-9303
"""
num_rows = 200000
report_frequency = 0.1 # every 100 milliseconds
stress_table = 'keyspace1.standard1'
ratefile = self.get_temp_file()
tempfile = self.get_temp_file()

def check_rate_file():
lines = [line.rstrip('\n') for line in open(ratefile.name)]
logger.debug(lines)
assert lines[-1].startswith('Processed: {} rows;'.format(num_rows))

self.prepare()

logger.debug('Running stress')
self.node1.stress(['write', 'n={}'.format(num_rows), 'no-warmup', '-rate', 'threads=50'])

logger.debug('Exporting to csv file: {}'.format(tempfile.name))
self.run_cqlsh(cmds="COPY {} TO '{}' WITH RATEFILE='{}' AND REPORTFREQUENCY='{}'"
.format(stress_table, tempfile.name, ratefile.name, report_frequency))

# check all records were exported
assert num_rows == len(open(tempfile.name).readlines())

check_rate_file()

# clean-up
os.unlink(ratefile.name)
self.session.execute("TRUNCATE {}".format(stress_table))

logger.debug('Importing from csv file: {}'.format(tempfile.name))
self.run_cqlsh(cmds="COPY {} FROM '{}' WITH RATEFILE='{}' AND REPORTFREQUENCY='{}'"
.format(stress_table, tempfile.name, ratefile.name, report_frequency))

# check all records were imported
> assert [[num_rows]] == rows_to_list(self.session.execute("SELECT COUNT(*) FROM {}"
.format(stress_table)))

cqlsh_tests/test_cqlsh_copy.py:2136:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
../cassandra/build/venv/src/cassandra-driver/cassandra/cluster.py:2618: in execute
return self.execute_async(query, parameters, trace, custom_payload, timeout, execution_profile, paging_state, host, execute_as).result()
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

self = <ResponseFuture: query='<SimpleStatement query="SELECT COUNT(*) FROM keyspace1.standard1", consistency=Not Set>' reque...9042': 'Client request timeout. See Session.execute[_async](timeout)'}, last_host=127.0.0.1:9042 coordinator_host=None>

def result(self):
"""
Return the final result or raise an Exception if errors were
encountered. If the final result or error has not been set
yet, this method will block until it is set, or the timeout
set for the request expires.

Timeout is specified in the Session request execution functions.
If the timeout is exceeded, an :exc:`cassandra.OperationTimedOut` will be raised.
This is a client-side timeout. For more information
about server-side coordinator timeouts, see :class:`.policies.RetryPolicy`.

Example usage::

>>> future = session.execute_async("SELECT * FROM mycf")
>>> # do other stuff...

>>> try:
... rows = future.result()
... for row in rows:
... ... # process results
... except Exception:
... log.exception("Operation failed:")

"""
self._event.wait()
if self._final_result is not _NOT_SET:
return ResultSet(self, self._final_result)
else:
> raise self._final_exception
E cassandra.OperationTimedOut: errors={'127.0.0.1:9042': 'Client request timeout. See Session.execute[_async](timeout)'}, last_host=127.0.0.1:9042

../cassandra/build/venv/src/cassandra-driver/cassandra/cluster.py:4894: OperationTimedOut
265.524
8_cythonno_x86_64_15_64test_decommissioned_node_cant_rejoinFailureccmlib.node.TimeoutError: timed out and did not find log entry: This node was decommissioned and will not rejoin the ring

self = <topology_test.TestTopology object at 0x7f50f4f12070>

@since('3.0')
def test_decommissioned_node_cant_rejoin(self):
"""
@jira_ticket CASSANDRA-8801

Test that a decommissioned node can't rejoin the cluster by:

- creating a cluster,
- decommissioning a node, and
- asserting that the "decommissioned node won't rejoin" error is in the
logs for that node and
- asserting that the node is not running.
"""
rejoin_err = 'This node was decommissioned and will not rejoin the ring'
self.fixture_dtest_setup.ignore_log_patterns = list(self.fixture_dtest_setup.ignore_log_patterns) + [
rejoin_err]

self.cluster.populate(3).start()
node1, node2, node3 = self.cluster.nodelist()

logger.debug('decommissioning...')
node3.decommission(force=self.cluster.version() >= '4.0')
logger.debug('stopping...')
node3.stop()
logger.debug('attempting restart...')
node3.start(wait_other_notice=False)
timedout = False
try:
# usually takes 3 seconds, so give it a generous 15
node3.watch_log_for(rejoin_err, timeout=15)
except TimeoutError:
# TimeoutError is not very helpful to the reader of the test output;
# let that pass and move on to string assertion below
timedout = True

n3errors = node3.grep_log_for_errors()
if len(n3errors) == 0 and timedout:
> raise TimeoutError("timed out and did not find log entry: " + rejoin_err)
E ccmlib.node.TimeoutError: timed out and did not find log entry: This node was decommissioned and will not rejoin the ring

topology_test.py:425: TimeoutError
140.245