Skip to content

Commit

Permalink
Block SyncPoint in util/db_test_util.h in released Windows mode.
Browse files Browse the repository at this point in the history
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
  • Loading branch information
yhchiang committed Jul 14, 2015
1 parent 05e1941 commit 0936362
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 0 deletions.
1 change: 1 addition & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -153,6 +153,7 @@ set(SOURCES
util/comparator.cc
util/crc32c.cc
util/db_info_dumper.cc
util/db_test_util.cc
util/dynamic_bloom.cc
util/env.cc
util/env_hdfs.cc
Expand Down
3 changes: 3 additions & 0 deletions util/db_test_util.cc
Original file line number Diff line number Diff line change
Expand Up @@ -57,9 +57,12 @@ DBTestBase::DBTestBase(const std::string path) : option_config_(kDefault),
}

DBTestBase::~DBTestBase() {
// SyncPoint is not supported in Released Windows Mode.
#if !(defined NDEBUG) || !defined(OS_WIN)
rocksdb::SyncPoint::GetInstance()->DisableProcessing();
rocksdb::SyncPoint::GetInstance()->LoadDependency({});
rocksdb::SyncPoint::GetInstance()->ClearAllCallBacks();
#endif // !(defined NDEBUG) || !defined(OS_WIN)
Close();
Options options;
options.db_paths.emplace_back(dbname_, 0);
Expand Down
6 changes: 6 additions & 0 deletions util/db_test_util.h
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,10 @@
#include "util/mutexlock.h"
#include "util/scoped_arena_iterator.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"
#endif // !(defined NDEBUG) || !defined(OS_WIN)
#include "util/testharness.h"
#include "util/testutil.h"
#include "util/xfunc.h"
Expand Down Expand Up @@ -144,11 +147,14 @@ class SpecialEnv : public EnvWrapper {
}
}
Status Close() override {
// SyncPoint is not supported in Released Windows Mode.
#if !(defined NDEBUG) || !defined(OS_WIN)
// Check preallocation size
// preallocation size is never passed to base file.
size_t preallocation_size = preallocation_block_size();
TEST_SYNC_POINT_CALLBACK("DBTestWritableFile.GetPreallocationStatus",
&preallocation_size);
#endif // !(defined NDEBUG) || !defined(OS_WIN)
return base_->Close();
}
Status Flush() override { return base_->Flush(); }
Expand Down

0 comments on commit 0936362

Please sign in to comment.