Skip to content

Commit

Permalink
Increase number of writes in concurrency test to ensure conflict (#6641)
Browse files Browse the repository at this point in the history
(cherry picked from commit b52f1ea)
  • Loading branch information
eddyashton committed Nov 13, 2024
1 parent 95614d0 commit b7e2d16
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/kv/test/kv_contention.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -252,6 +252,8 @@ DOCTEST_TEST_CASE("Concurrent kv access" * doctest::test_suite("concurrency"))
DOCTEST_TEST_CASE(
"get_version_of_previous_write ordering" * doctest::test_suite("concurrency"))
{
ccf::logger::config::level() = LoggerLevel::INFO;

// Many threads attempt to produce a chain of transactions pointing at the
// previous write to a single key, at that key.
ccf::kv::Store kv_store;
Expand Down Expand Up @@ -315,7 +317,7 @@ DOCTEST_TEST_CASE(

std::vector<std::thread> threads;
constexpr auto num_threads = 64;
constexpr auto writes_per_thread = 10;
constexpr auto writes_per_thread = 100;
for (size_t i = 0; i < num_threads; ++i)
{
threads.emplace_back([&]() {
Expand All @@ -331,6 +333,7 @@ DOCTEST_TEST_CASE(
thread.join();
}

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

Expand Down

0 comments on commit b7e2d16

Please sign in to comment.