Fix fault_injestion_test

Summary: A bug in MockEnv causes fault_injestion_test to fail. I don't know why it doesn't fail every time but it doesn't seem to be right.

Test Plan:
Run fault_injestion_test
Also run db_test with MEM_ENV=1 until the first failure.

Reviewers: yhchiang, rven, igor

Reviewed By: igor

Subscribers: leveldb, dhruba

Differential Revision: https://reviews.facebook.net/D32877
This commit is contained in:
sdong 2015-02-04 15:32:06 -08:00
parent b37f5ffc76
commit fe9f691194

View File

@ -630,10 +630,10 @@ Status MockEnv::LockFile(const std::string& fname, FileLock** flock) {
return Status::IOError(fn, "Lock is already held.");
}
} else {
auto* file = new MemFile(fname, true);
auto* file = new MemFile(fn, true);
file->Ref();
file->Lock();
file_map_[fname] = file;
file_map_[fn] = file;
}
}
*flock = new MockEnvFileLock(fn);