test_dont_archive_commitlog | Failure | AssertionError: It's been over 180s and we haven't written a new commitlog segment. Something is wrong.
self = <snapshot_test.TestArchiveCommitlog object at 0x7f581499ff40>
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 0x7f5812f1d130>
commitlog_dir = '/home/cassandra/cassandra/build/run-python-dtest.bMFOfU/dtest-lq8nplnq/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 | 253.267 |