Skip to content

Commit b01a041

Browse files
xingbowangNavi
andcommitted
Fix nightly CI regressions from #14478
Fix two build failures introduced by the accelerate-build PR (#14478): 1. **Release build (NDEBUG) compile error**: The SyncPoint cleanup listener in testharness.cc referenced SyncPoint::GetInstance() which is only declared in debug builds. Guard the listener with #ifndef NDEBUG since it's only needed for debug test sharding anyway. 2. **Folly-lite link error**: The USE_FOLLY_LITE cmake path unconditionally linked -lglog, but glog may not be installed as a system library. Use find_library() to only link glog when available. Co-authored-by: Navi <navi@navibot.dev>
1 parent f8ff77d commit b01a041

File tree

3 files changed

+12
-1
lines changed

3 files changed

+12
-1
lines changed

CMakeLists.txt

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1137,7 +1137,10 @@ if(USE_FOLLY_LITE)
11371137
include_directories(${FMT_INCLUDE_DIR})
11381138

11391139
add_definitions(-DUSE_FOLLY -DFOLLY_NO_CONFIG)
1140-
list(APPEND THIRDPARTY_LIBS glog)
1140+
find_library(GLOG_LIBRARY glog)
1141+
if(GLOG_LIBRARY)
1142+
list(APPEND THIRDPARTY_LIBS glog)
1143+
endif()
11411144
endif()
11421145

11431146
set(ROCKSDB_STATIC_LIB rocksdb${ARTIFACT_SUFFIX})

db/db_compaction_test.cc

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -560,6 +560,7 @@ TEST_F(DBCompactionTest, UniversalReduceFileLockingRepickNothing) {
560560
ASSERT_OK(Flush());
561561
ASSERT_OK(dbfull()->TEST_WaitForCompact());
562562
ASSERT_TRUE(bottom_pri_compaction_attempt_repick);
563+
Env::Default()->SetBackgroundThreads(0, Env::Priority::BOTTOM);
563564
}
564565

565566
TEST_F(DBCompactionTest, SkipStatsUpdateTest) {
@@ -10643,6 +10644,7 @@ TEST_F(DBCompactionTest, BottomPriCompactionCountsTowardConcurrencyLimit) {
1064310644
sleeping_task_low.WaitUntilDone();
1064410645
compact_range_thread.join();
1064510646
}
10647+
env_->SetBackgroundThreads(0, Env::Priority::BOTTOM);
1064610648
}
1064710649

1064810650
TEST_F(DBCompactionTest, BottommostFileCompactionAllowIngestBehind) {
@@ -11462,6 +11464,8 @@ TEST_F(DBCompactionTest, ReleaseCompactionDuringManifestWrite) {
1146211464

1146311465
SyncPoint::GetInstance()->DisableProcessing();
1146411466
SyncPoint::GetInstance()->ClearAllCallBacks();
11467+
env_->SetBackgroundThreads(1, Env::Priority::LOW);
11468+
env_->SetBackgroundThreads(0, Env::Priority::BOTTOM);
1146511469
}
1146611470

1146711471
TEST_F(DBCompactionTest, RecordNewestKeyTimeForTtlCompaction) {

test_util/testharness.cc

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,12 @@
1313
#include <string>
1414
#include <thread>
1515

16+
#ifndef NDEBUG
1617
#include "test_util/sync_point.h"
18+
#endif
1719

1820
namespace {
21+
#ifndef NDEBUG
1922
// Global gtest event listener that cleans up SyncPoint state after every
2023
// test. Many tests set SyncPoint callbacks with captured local variables
2124
// but forget to disable/clear them. Under sharded execution (multiple
@@ -45,6 +48,7 @@ static int RegisterSyncPointCleanup() noexcept {
4548
// NOLINTNEXTLINE(cppcoreguidelines-avoid-non-const-global-variables)
4649
[[maybe_unused]] static int sync_point_cleanup_registered_ =
4750
RegisterSyncPointCleanup();
51+
#endif // !NDEBUG
4852
} // namespace
4953

5054
namespace ROCKSDB_NAMESPACE::test {

0 commit comments

Comments
 (0)