Skip to content

Commit 51ea889

Browse files
committed
Fix travis builds
Summary: Lots of travis builds are failing because on EnvPosixTest.RandomAccessUniqueID: https://travis-ci.org/facebook/rocksdb/builds/34400833 This is the result of their environment and not because of RocksDB's bug. Also note that RocksDB works correctly even though UniqueID feature is not present in the system (as it's the case with os x) Test Plan: OPT=-DTRAVIS make env_test && ./env_test Observed that offending tests are not being run Reviewers: sdong, yhchiang, ljin Reviewed By: ljin Subscribers: leveldb Differential Revision: https://reviews.facebook.net/D22803
1 parent a481626 commit 51ea889

File tree

2 files changed

+7
-4
lines changed

2 files changed

+7
-4
lines changed

.travis.yml

+1-2
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@ before_install:
1414
- sudo dpkg -i libgflags-dev_2.0-1_amd64.deb
1515
# Lousy hack to disable use and testing of fallocate, which doesn't behave quite
1616
# as EnvPosixTest::AllocateTest expects within the Travis OpenVZ environment.
17-
- sed -i "s/fallocate(/HACK_NO_fallocate(/" build_tools/build_detect_platform
18-
script: make check -j8
17+
script: OPT=-DTRAVIS make check -j8
1918
notifications:
2019
email: false

util/env_test.cc

+6-2
Original file line numberDiff line numberDiff line change
@@ -392,6 +392,9 @@ TEST(EnvPosixTest, DecreaseNumBgThreads) {
392392
}
393393

394394
#ifdef OS_LINUX
395+
// Travis doesn't support fallocate or getting unique ID from files for whatever
396+
// reason.
397+
#ifndef TRAVIS
395398
// To make sure the Env::GetUniqueId() related tests work correctly, The files
396399
// should be stored in regular storage like "hard disk" or "flash device".
397400
// Otherwise we cannot get the correct id.
@@ -507,7 +510,7 @@ TEST(EnvPosixTest, AllocateTest) {
507510
// verify that preallocated blocks were deallocated on file close
508511
ASSERT_GT(st_blocks, f_stat.st_blocks);
509512
}
510-
#endif
513+
#endif // ROCKSDB_FALLOCATE_PRESENT
511514

512515
// Returns true if any of the strings in ss are the prefix of another string.
513516
bool HasPrefix(const std::unordered_set<std::string>& ss) {
@@ -638,7 +641,8 @@ TEST(EnvPosixTest, InvalidateCache) {
638641
// Delete the file
639642
ASSERT_OK(env_->DeleteFile(fname));
640643
}
641-
#endif
644+
#endif // not TRAVIS
645+
#endif // OS_LINUX
642646

643647
TEST(EnvPosixTest, PosixRandomRWFileTest) {
644648
EnvOptions soptions;

0 commit comments

Comments
 (0)