From c8117584e3ebd331ed7aea8ec91751242d607a4e Mon Sep 17 00:00:00 2001 From: Nadav Har'El Date: Mon, 24 May 2021 12:31:51 +0300 Subject: [PATCH] test/cql-pytest: clean up test_create_large_static_cells_and_rows The test test_create_large_static_cells_and_rows had its own implementation of "nodetool flush" using Scylla's REST API. Now that we have a nodetool.flush() function for general use in cql-pytest, let's use it and save a bit of duplication. Another benefit is that now this test can be run (and pass) against Cassandra. To allow this test to run on Cassandra, I had to remove a "USING TIMEOUT" which wasn't necessary for this test, and is not a feature supported by Cassandra. Signed-off-by: Nadav Har'El --- test/cql-pytest/test_large_cells_rows.py | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/test/cql-pytest/test_large_cells_rows.py b/test/cql-pytest/test_large_cells_rows.py index 3a40e5aa38..44bf56dd04 100644 --- a/test/cql-pytest/test_large_cells_rows.py +++ b/test/cql-pytest/test_large_cells_rows.py @@ -18,6 +18,7 @@ from util import new_test_table import requests +import nodetool def test_create_large_static_cells_and_rows(cql, test_keyspace): '''Test that `large_data_handler` successfully reports large static cells @@ -26,18 +27,13 @@ def test_create_large_static_cells_and_rows(cql, test_keyspace): This is a regression test for https://github.com/scylladb/scylla/issues/6780''' schema = "pk int, ck int, user_ids set static, PRIMARY KEY (pk, ck)" with new_test_table(cql, test_keyspace, schema) as table: - insert_stmt = cql.prepare(f"INSERT INTO {table} (pk, ck, user_ids) VALUES (?, ?, ?) USING TIMEOUT 5m") + insert_stmt = cql.prepare(f"INSERT INTO {table} (pk, ck, user_ids) VALUES (?, ?, ?)") # Default large data threshold for cells is 1 mb, for rows it is 10 mb. # Take 10 mb cell to trigger large data reporting code both for # static cells and static rows simultaneously. large_set = {'x' * 1024 * 1024 * 10} cql.execute(insert_stmt, [1, 1, large_set]) - # REST API endpoint address for test scylla node - node_address = f'http://{cql.cluster.contact_points[0]}:10000' - # Execute force flush of test table to persistent storage, which is necessary to trigger - # `large_data_handler` execution. - table_without_ks = table[table.find('.') + 1:] # strip keyspace part from the table name - requests.post(f'{node_address}/storage_service/keyspace_flush/{test_keyspace}', params={'cf' : table_without_ks}) + nodetool.flush(cql, table) # No need to check that the Scylla server is running here, since the test will - # fail automatically in case Scylla crashes. \ No newline at end of file + # fail automatically in case Scylla crashes.