skip direct I/O tests in rocksdb lite (#6867)

Summary:
Fix a couple places where direct I/O was used even though it is
unsupported in lite builds.
Pull Request resolved: https://github.com/facebook/rocksdb/pull/6867

Test Plan: `LITE=1 make check -j48`

Reviewed By: pdillinger

Differential Revision: D21689185

Pulled By: ajkr

fbshipit-source-id: 3eaa3abf69cd7d0bcaabbcad3bb5a26fb8dd7301
main
Andrew Kryczka 5 years ago committed by Facebook GitHub Bot
parent 38be686160
commit 292bcf6227
  1. 5
      file/random_access_file_reader_test.cc
  2. 8
      table/block_based/block_based_table_reader_test.cc
  3. 5
      table/block_fetcher_test.cc

@ -74,6 +74,9 @@ class RandomAccessFileReaderTest : public testing::Test {
} }
}; };
// Skip the following tests in lite mode since direct I/O is unsupported.
#ifndef ROCKSDB_LITE
TEST_F(RandomAccessFileReaderTest, ReadDirectIO) { TEST_F(RandomAccessFileReaderTest, ReadDirectIO) {
std::string fname = "read-direct-io"; std::string fname = "read-direct-io";
Random rand(0); Random rand(0);
@ -247,6 +250,8 @@ TEST_F(RandomAccessFileReaderTest, MultiReadDirectIO) {
} }
} }
#endif // ROCKSDB_LITE
} // namespace ROCKSDB_NAMESPACE } // namespace ROCKSDB_NAMESPACE
int main(int argc, char** argv) { int main(int argc, char** argv) {

@ -221,10 +221,18 @@ TEST_P(BlockBasedTableReaderTest, MultiGet) {
// Param 1: compression type // Param 1: compression type
// Param 2: whether to use direct reads // Param 2: whether to use direct reads
#ifdef ROCKSDB_LITE
// Skip direct I/O tests in lite mode since direct I/O is unsupported.
INSTANTIATE_TEST_CASE_P(
MultiGet, BlockBasedTableReaderTest,
::testing::Combine(::testing::ValuesIn(GetSupportedCompressions()),
::testing::Values(false)));
#else // ROCKSDB_LITE
INSTANTIATE_TEST_CASE_P( INSTANTIATE_TEST_CASE_P(
MultiGet, BlockBasedTableReaderTest, MultiGet, BlockBasedTableReaderTest,
::testing::Combine(::testing::ValuesIn(GetSupportedCompressions()), ::testing::Combine(::testing::ValuesIn(GetSupportedCompressions()),
::testing::Bool())); ::testing::Bool()));
#endif // ROCKSDB_LITE
} // namespace ROCKSDB_NAMESPACE } // namespace ROCKSDB_NAMESPACE

@ -339,6 +339,9 @@ class BlockFetcherTest : public testing::Test {
} }
}; };
// Skip the following tests in lite mode since direct I/O is unsupported.
#ifndef ROCKSDB_LITE
// Fetch index block under both direct IO and non-direct IO. // Fetch index block under both direct IO and non-direct IO.
// Expects: // Expects:
// the index block contents are the same for both read modes. // the index block contents are the same for both read modes.
@ -437,6 +440,8 @@ TEST_F(BlockFetcherTest, FetchAndUncompressCompressedDataBlock) {
expected_non_direct_io_stats, expected_direct_io_stats); expected_non_direct_io_stats, expected_direct_io_stats);
} }
#endif // ROCKSDB_LITE
} // namespace } // namespace
} // namespace ROCKSDB_NAMESPACE } // namespace ROCKSDB_NAMESPACE

Loading…
Cancel
Save