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
This commit is contained in:
parent
d1f24dc7ee
commit
a9639bda84
@ -2799,16 +2799,17 @@ TEST(DBTest, FlushSchedule) {
|
|||||||
CreateAndReopenWithCF({"pikachu"}, &options);
|
CreateAndReopenWithCF({"pikachu"}, &options);
|
||||||
std::vector<std::thread> threads;
|
std::vector<std::thread> threads;
|
||||||
|
|
||||||
std::atomic<int> thread_num;
|
std::atomic<int> thread_num(0);
|
||||||
// each column family will have 5 thread, each thread generating 2 memtables.
|
// each column family will have 5 thread, each thread generating 2 memtables.
|
||||||
// each column family should end up with 10 table files
|
// each column family should end up with 10 table files
|
||||||
for (int i = 0; i < 10; ++i) {
|
for (int i = 0; i < 10; ++i) {
|
||||||
threads.emplace_back([&]() {
|
threads.emplace_back([&]() {
|
||||||
int a = thread_num.fetch_add(1);
|
int a = thread_num.fetch_add(1);
|
||||||
Random rnd(a);
|
Random rnd(a);
|
||||||
|
WriteOptions wo;
|
||||||
// this should fill up 2 memtables
|
// this should fill up 2 memtables
|
||||||
for (int k = 0; k < 5000; ++k) {
|
for (int k = 0; k < 5000; ++k) {
|
||||||
Put(a & 1, RandomString(&rnd, 13), "");
|
ASSERT_OK(db_->Put(wo, handles_[a & 1], RandomString(&rnd, 13), ""));
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user