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 <alejo.sanchez@scylladb.com>
This commit is contained in:
Alejo Sanchez
2023-06-28 14:58:49 +02:00
parent 70a3179888
commit d4697ed21e

View File

@@ -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.