Block SyncPoint in util/db_test_util.h in released Windows mode.

Summary: Block SyncPoint in util/db_test_util.h in released Windows mode.

Test Plan: db_test

Reviewers: igor, anthony, sdong, IslamAbdelRahman

Reviewed By: sdong, IslamAbdelRahman

Subscribers: dhruba, leveldb

Differential Revision: https://reviews.facebook.net/D42213
This commit is contained in:
Yueh-Hsuan Chiang 2015-07-14 16:02:31 -07:00
parent 05e194158c
commit 0936362a70
3 changed files with 10 additions and 0 deletions

View File

@ -153,6 +153,7 @@ set(SOURCES
util/comparator.cc util/comparator.cc
util/crc32c.cc util/crc32c.cc
util/db_info_dumper.cc util/db_info_dumper.cc
util/db_test_util.cc
util/dynamic_bloom.cc util/dynamic_bloom.cc
util/env.cc util/env.cc
util/env_hdfs.cc util/env_hdfs.cc

View File

@ -57,9 +57,12 @@ DBTestBase::DBTestBase(const std::string path) : option_config_(kDefault),
} }
DBTestBase::~DBTestBase() { DBTestBase::~DBTestBase() {
// SyncPoint is not supported in Released Windows Mode.
#if !(defined NDEBUG) || !defined(OS_WIN)
rocksdb::SyncPoint::GetInstance()->DisableProcessing(); rocksdb::SyncPoint::GetInstance()->DisableProcessing();
rocksdb::SyncPoint::GetInstance()->LoadDependency({}); rocksdb::SyncPoint::GetInstance()->LoadDependency({});
rocksdb::SyncPoint::GetInstance()->ClearAllCallBacks(); rocksdb::SyncPoint::GetInstance()->ClearAllCallBacks();
#endif // !(defined NDEBUG) || !defined(OS_WIN)
Close(); Close();
Options options; Options options;
options.db_paths.emplace_back(dbname_, 0); options.db_paths.emplace_back(dbname_, 0);

View File

@ -47,7 +47,10 @@
#include "util/mutexlock.h" #include "util/mutexlock.h"
#include "util/scoped_arena_iterator.h" #include "util/scoped_arena_iterator.h"
#include "util/string_util.h" #include "util/string_util.h"
// SyncPoint is not supported in Released Windows Mode.
#if !(defined NDEBUG) || !defined(OS_WIN)
#include "util/sync_point.h" #include "util/sync_point.h"
#endif // !(defined NDEBUG) || !defined(OS_WIN)
#include "util/testharness.h" #include "util/testharness.h"
#include "util/testutil.h" #include "util/testutil.h"
#include "util/xfunc.h" #include "util/xfunc.h"
@ -144,11 +147,14 @@ class SpecialEnv : public EnvWrapper {
} }
} }
Status Close() override { Status Close() override {
// SyncPoint is not supported in Released Windows Mode.
#if !(defined NDEBUG) || !defined(OS_WIN)
// Check preallocation size // Check preallocation size
// preallocation size is never passed to base file. // preallocation size is never passed to base file.
size_t preallocation_size = preallocation_block_size(); size_t preallocation_size = preallocation_block_size();
TEST_SYNC_POINT_CALLBACK("DBTestWritableFile.GetPreallocationStatus", TEST_SYNC_POINT_CALLBACK("DBTestWritableFile.GetPreallocationStatus",
&preallocation_size); &preallocation_size);
#endif // !(defined NDEBUG) || !defined(OS_WIN)
return base_->Close(); return base_->Close();
} }
Status Flush() override { return base_->Flush(); } Status Flush() override { return base_->Flush(); }