Skip to content

Commit a9639bd

Browse files
committed
Fix valgrind test
Summary: Get valgrind to stop complaining about uninitialized value Test Plan: valgrind not complaining anymore Reviewers: sdong, yhchiang, ljin Reviewed By: ljin Subscribers: leveldb Differential Revision: https://reviews.facebook.net/D23289
1 parent d1f24dc commit a9639bd

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

db/db_test.cc

+3-2
Original file line numberDiff line numberDiff line change
@@ -2799,16 +2799,17 @@ TEST(DBTest, FlushSchedule) {
27992799
CreateAndReopenWithCF({"pikachu"}, &options);
28002800
std::vector<std::thread> threads;
28012801

2802-
std::atomic<int> thread_num;
2802+
std::atomic<int> thread_num(0);
28032803
// each column family will have 5 thread, each thread generating 2 memtables.
28042804
// each column family should end up with 10 table files
28052805
for (int i = 0; i < 10; ++i) {
28062806
threads.emplace_back([&]() {
28072807
int a = thread_num.fetch_add(1);
28082808
Random rnd(a);
2809+
WriteOptions wo;
28092810
// this should fill up 2 memtables
28102811
for (int k = 0; k < 5000; ++k) {
2811-
Put(a & 1, RandomString(&rnd, 13), "");
2812+
ASSERT_OK(db_->Put(wo, handles_[a & 1], RandomString(&rnd, 13), ""));
28122813
}
28132814
});
28142815
}

0 commit comments

Comments
 (0)