From d4697ed21ebfacf55b2423ffa9483d73cf083483 Mon Sep 17 00:00:00 2001 From: Alejo Sanchez Date: Wed, 28 Jun 2023 14:58:49 +0200 Subject: [PATCH] test/boost/index_with_paging_test: parallel insert Parallelize inserts for long-running test_index_with_paging. Run time in debug mode reduced by 1 minute 48 seconds. Refs #13905 Signed-off-by: Alejo Sanchez --- test/boost/index_with_paging_test.cc | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/test/boost/index_with_paging_test.cc b/test/boost/index_with_paging_test.cc index 4c210e682d..e22d536c2a 100644 --- a/test/boost/index_with_paging_test.cc +++ b/test/boost/index_with_paging_test.cc @@ -22,14 +22,15 @@ SEASTAR_TEST_CASE(test_index_with_paging) { // There should be enough rows to use multiple pages auto prepared_id = e.prepare("INSERT INTO tab (pk, ck, v, v2, v3) VALUES (?, ?, 1, ?, ?)").get0(); auto big_string_v = cql3::raw_value::make_value(serialized(big_string)); - for (int i = 0; i < 64 * 1024; ++i) { - e.execute_prepared(prepared_id, { + max_concurrent_for_each(boost::irange(0, 64 * 1024), 2, [&] (auto i) { + return e.execute_prepared(prepared_id, { cql3::raw_value::make_value(serialized(i % 3)), // pk cql3::raw_value::make_value(serialized(format("hello{}", i))), // ck cql3::raw_value::make_value(int32_type->decompose(data_value(i))), // v2 big_string_v, // v3 - }).get(); - } + + }).discard_result(); + }).get(); e.db().invoke_on_all([] (replica::database& db) { // The semaphore's queue has to able to absorb one read / row in this test.