Skip to content

Commit

Permalink
test(p0): add more elements into the list increase ConcurrentReadTest…
Browse files Browse the repository at this point in the history
… runtime (#796)

Signed-off-by: Yuchen Liang <[email protected]>
  • Loading branch information
yliang412 authored Jan 11, 2025
1 parent a5d44d7 commit 01a64ff
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion test/primer/skiplist_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -332,7 +332,9 @@ TEST(SkipListTest, ConcurrentReadTest) {
std::vector<std::thread> threads;
threads.reserve(num_threads);

const int total_num_elements = num_threads * 8192;
// Note: you might want to first try use a smaller number of elements
// if you are running this test on local machine.
const int total_num_elements = num_threads * 100000;
auto list = std::make_unique<SkipList<int>>();
// Insert some elements into the skip list
for (int i = 0; i < total_num_elements; ++i) {
Expand All @@ -347,6 +349,7 @@ TEST(SkipListTest, ConcurrentReadTest) {
};

// Launch threads to perform concurrent reads
// Note: You will see a timeout if your reads cannot share access to the skip list
for (int i = 0; i < num_threads; ++i) {
threads.emplace_back(read_task, 0, total_num_elements);
}
Expand Down

0 comments on commit 01a64ff

Please sign in to comment.