From 0b94468bbacf4eafc5d1c47d3431edb2cc93844d Mon Sep 17 00:00:00 2001 From: Yanqin Jin Date: Tue, 3 Nov 2020 09:47:06 -0800 Subject: [PATCH] Avoid skipping a test in db_wal_test (#7628) Summary: Recent test report shows that some tests have been skipped. For DBWALTest that inherits from DBTestBase, the following will always be true, since `env_` is an instance of `SpecialEnv`, not `Env::Default()`. Thus the test will always be skipped. ``` if (options.env != Env::Default()) { ROCKSDB_GTEST_SKIP("Test requires default environment"); return; } ``` Pull Request resolved: https://github.com/facebook/rocksdb/pull/7628 Test Plan: ./db_wal_test --gtest_filter=DBWALTest.TruncateLastLogAfterRecoverWithoutFlush MEM_ENV=1 ./db_wal_test --gtest_filter=DBWALTest.TruncateLastLogAfterRecoverWithoutFlush make check Reviewed By: jay-zhuang Differential Revision: D24693006 Pulled By: riversand963 fbshipit-source-id: 7f2a772492a0f11bff17bbf5e9f493e9e9a1c125 --- db/db_wal_test.cc | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/db/db_wal_test.cc b/db/db_wal_test.cc index d0f3787b8..8bf19bf3b 100644 --- a/db/db_wal_test.cc +++ b/db/db_wal_test.cc @@ -1696,9 +1696,10 @@ TEST_F(DBWALTest, RestoreTotalLogSizeAfterRecoverWithoutFlush) { TEST_F(DBWALTest, TruncateLastLogAfterRecoverWithoutFlush) { constexpr size_t kKB = 1024; Options options = CurrentOptions(); + options.env = env_; options.avoid_flush_during_recovery = true; - if (options.env != Env::Default()) { - ROCKSDB_GTEST_SKIP("Test requires default environment"); + if (mem_env_) { + ROCKSDB_GTEST_SKIP("Test requires non-mem environment"); return; } // Test fallocate support of running file system.