Skip to content

Commit b52f1ea

Browse files
authored
Increase number of writes in concurrency test to ensure conflict (#6641)
1 parent 852609a commit b52f1ea

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/kv/test/kv_contention.cpp

+4-1
Original file line numberDiff line numberDiff line change
@@ -252,6 +252,8 @@ DOCTEST_TEST_CASE("Concurrent kv access" * doctest::test_suite("concurrency"))
252252
DOCTEST_TEST_CASE(
253253
"get_version_of_previous_write ordering" * doctest::test_suite("concurrency"))
254254
{
255+
ccf::logger::config::level() = LoggerLevel::INFO;
256+
255257
// Many threads attempt to produce a chain of transactions pointing at the
256258
// previous write to a single key, at that key.
257259
ccf::kv::Store kv_store;
@@ -315,7 +317,7 @@ DOCTEST_TEST_CASE(
315317

316318
std::vector<std::thread> threads;
317319
constexpr auto num_threads = 64;
318-
constexpr auto writes_per_thread = 10;
320+
constexpr auto writes_per_thread = 100;
319321
for (size_t i = 0; i < num_threads; ++i)
320322
{
321323
threads.emplace_back([&]() {
@@ -331,6 +333,7 @@ DOCTEST_TEST_CASE(
331333
thread.join();
332334
}
333335

336+
LOG_INFO_FMT("Found {} conflicts", conflict_count);
334337
DOCTEST_CHECK(conflict_count > 0);
335338
constexpr auto last_write_version = num_threads * writes_per_thread;
336339

0 commit comments

Comments
 (0)