fix test failure
Summary: fix Rocksdb Unit Test USER_FAILURE Test Plan: make all check -j64 Reviewers: sdong, andrewkr Reviewed By: andrewkr Subscribers: andrewkr, dhruba, leveldb Differential Revision: https://reviews.facebook.net/D60603
This commit is contained in:
parent
e295da1266
commit
816ae098ea
@ -1118,13 +1118,13 @@ TEST_F(DBSSTTest, AddExternalSstFileListAtomicity) {
|
|||||||
// files[1].sst (100 => 199)
|
// files[1].sst (100 => 199)
|
||||||
// ...
|
// ...
|
||||||
// file[8].sst (800 => 899)
|
// file[8].sst (800 => 899)
|
||||||
size_t n = 9;
|
int n = 9;
|
||||||
std::vector<std::string> files(n);
|
std::vector<std::string> files(n);
|
||||||
std::vector<ExternalSstFileInfo> files_info(n);
|
std::vector<ExternalSstFileInfo> files_info(n);
|
||||||
for (size_t i = 0; i < n; i++) {
|
for (int i = 0; i < n; i++) {
|
||||||
files[i] = sst_files_folder + "file" + std::to_string(i) + ".sst";
|
files[i] = sst_files_folder + "file" + std::to_string(i) + ".sst";
|
||||||
ASSERT_OK(sst_file_writer.Open(files[i]));
|
ASSERT_OK(sst_file_writer.Open(files[i]));
|
||||||
for (size_t k = i * 100; k < (i + 1) * 100; k++) {
|
for (int k = i * 100; k < (i + 1) * 100; k++) {
|
||||||
ASSERT_OK(sst_file_writer.Add(Key(k), Key(k) + "_val"));
|
ASSERT_OK(sst_file_writer.Add(Key(k), Key(k) + "_val"));
|
||||||
}
|
}
|
||||||
Status s = sst_file_writer.Finish(&files_info[i]);
|
Status s = sst_file_writer.Finish(&files_info[i]);
|
||||||
@ -1137,12 +1137,12 @@ TEST_F(DBSSTTest, AddExternalSstFileListAtomicity) {
|
|||||||
files.push_back(sst_files_folder + "file" + std::to_string(n) + ".sst");
|
files.push_back(sst_files_folder + "file" + std::to_string(n) + ".sst");
|
||||||
auto s = db_->AddFile(files);
|
auto s = db_->AddFile(files);
|
||||||
ASSERT_NOK(s) << s.ToString();
|
ASSERT_NOK(s) << s.ToString();
|
||||||
for (size_t k = 0; k < n * 100; k++) {
|
for (int k = 0; k < n * 100; k++) {
|
||||||
ASSERT_EQ("NOT_FOUND", Get(Key(k)));
|
ASSERT_EQ("NOT_FOUND", Get(Key(k)));
|
||||||
}
|
}
|
||||||
s = db_->AddFile(files_info);
|
s = db_->AddFile(files_info);
|
||||||
ASSERT_OK(s);
|
ASSERT_OK(s);
|
||||||
for (size_t k = 0; k < n * 100; k++) {
|
for (int k = 0; k < n * 100; k++) {
|
||||||
std::string value = Key(k) + "_val";
|
std::string value = Key(k) + "_val";
|
||||||
ASSERT_EQ(Get(Key(k)), value);
|
ASSERT_EQ(Get(Key(k)), value);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user