Skip to content

Commit 01a64ff

Browse files
authored
test(p0): add more elements into the list increase ConcurrentReadTest runtime (#796)
Signed-off-by: Yuchen Liang <[email protected]>
1 parent a5d44d7 commit 01a64ff

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

test/primer/skiplist_test.cpp

+4-1
Original file line numberDiff line numberDiff line change
@@ -332,7 +332,9 @@ TEST(SkipListTest, ConcurrentReadTest) {
332332
std::vector<std::thread> threads;
333333
threads.reserve(num_threads);
334334

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

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

0 commit comments

Comments
 (0)