Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Increase number of writes in concurrency test to ensure conflict #6641

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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