Status check enforcement for io_posix_test and options_settable_test (#6857)
Summary: Added status check enforcement for io_posix_test and options_settable_test Pull Request resolved: https://github.com/facebook/rocksdb/pull/6857 Test Plan: ASSERT_STATUS_CHECKED=1 make -j48 check Reviewed By: ajkr Differential Revision: D21647904 Pulled By: akankshamahajan15 fbshipit-source-id: b7f2321eb6c141a88cd5e1270ecb7d58f00341af
This commit is contained in:
parent
39b24432d4
commit
a1523efcdf
4
Makefile
4
Makefile
@ -668,7 +668,9 @@ ifdef ASSERT_STATUS_CHECKED
|
|||||||
# This is a new check for which we will add support incrementally. The
|
# This is a new check for which we will add support incrementally. The
|
||||||
# whitelist can be removed once support is fully added.
|
# whitelist can be removed once support is fully added.
|
||||||
TESTS_WHITELIST = \
|
TESTS_WHITELIST = \
|
||||||
options_test
|
options_test \
|
||||||
|
options_settable_test \
|
||||||
|
io_posix_test
|
||||||
TESTS := $(filter $(TESTS_WHITELIST),$(TESTS))
|
TESTS := $(filter $(TESTS_WHITELIST),$(TESTS))
|
||||||
PARALLEL_TEST := $(filter $(TESTS_WHITELIST),$(PARALLEL_TEST))
|
PARALLEL_TEST := $(filter $(TESTS_WHITELIST),$(PARALLEL_TEST))
|
||||||
endif
|
endif
|
||||||
|
2
env/io_posix.cc
vendored
2
env/io_posix.cc
vendored
@ -416,7 +416,7 @@ Status LogicalBlockSizeCache::RefAndCacheLogicalBlockSize(
|
|||||||
v.size = dir_size->second;
|
v.size = dir_size->second;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return Status::OK();
|
return s;
|
||||||
}
|
}
|
||||||
|
|
||||||
void LogicalBlockSizeCache::UnrefAndTryRemoveCachedLogicalBlockSize(
|
void LogicalBlockSizeCache::UnrefAndTryRemoveCachedLogicalBlockSize(
|
||||||
|
6
env/io_posix_test.cc
vendored
6
env/io_posix_test.cc
vendored
@ -67,7 +67,7 @@ TEST_F(LogicalBlockSizeCacheTest, Cache) {
|
|||||||
ASSERT_EQ(3, cache.GetLogicalBlockSize("/db2/sst2", 7));
|
ASSERT_EQ(3, cache.GetLogicalBlockSize("/db2/sst2", 7));
|
||||||
ASSERT_EQ(8, ncall);
|
ASSERT_EQ(8, ncall);
|
||||||
|
|
||||||
cache.RefAndCacheLogicalBlockSize({"/db"});
|
ASSERT_OK(cache.RefAndCacheLogicalBlockSize({"/db"}));
|
||||||
ASSERT_EQ(4, cache.Size());
|
ASSERT_EQ(4, cache.Size());
|
||||||
ASSERT_TRUE(cache.Contains("/"));
|
ASSERT_TRUE(cache.Contains("/"));
|
||||||
ASSERT_TRUE(cache.Contains("/db1"));
|
ASSERT_TRUE(cache.Contains("/db1"));
|
||||||
@ -104,7 +104,7 @@ TEST_F(LogicalBlockSizeCacheTest, Ref) {
|
|||||||
ASSERT_EQ(1, cache.GetLogicalBlockSize("/db/sst0", 1));
|
ASSERT_EQ(1, cache.GetLogicalBlockSize("/db/sst0", 1));
|
||||||
ASSERT_EQ(1, ncall);
|
ASSERT_EQ(1, ncall);
|
||||||
|
|
||||||
cache.RefAndCacheLogicalBlockSize({"/db"});
|
ASSERT_OK(cache.RefAndCacheLogicalBlockSize({"/db"}));
|
||||||
ASSERT_EQ(2, ncall);
|
ASSERT_EQ(2, ncall);
|
||||||
ASSERT_EQ(1, cache.GetRefCount("/db"));
|
ASSERT_EQ(1, cache.GetRefCount("/db"));
|
||||||
// Block size for /db is cached. Ref count = 1.
|
// Block size for /db is cached. Ref count = 1.
|
||||||
@ -112,7 +112,7 @@ TEST_F(LogicalBlockSizeCacheTest, Ref) {
|
|||||||
ASSERT_EQ(2, ncall);
|
ASSERT_EQ(2, ncall);
|
||||||
|
|
||||||
// Ref count = 2, but won't recompute the cached buffer size.
|
// Ref count = 2, but won't recompute the cached buffer size.
|
||||||
cache.RefAndCacheLogicalBlockSize({"/db"});
|
ASSERT_OK(cache.RefAndCacheLogicalBlockSize({"/db"}));
|
||||||
ASSERT_EQ(2, cache.GetRefCount("/db"));
|
ASSERT_EQ(2, cache.GetRefCount("/db"));
|
||||||
ASSERT_EQ(2, ncall);
|
ASSERT_EQ(2, ncall);
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user