From 56e342b2d9da49c732a5257aab51c83a88acdb01 Mon Sep 17 00:00:00 2001 From: Jerry Zhao Date: Mon, 3 Aug 2026 00:27:59 +0000 Subject: [PATCH 01/12] ci: use Ubuntu 24.04 runners --- .github/workflows/ci-linux.yml | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/.github/workflows/ci-linux.yml b/.github/workflows/ci-linux.yml index 09f0d3cb..eebecda3 100644 --- a/.github/workflows/ci-linux.yml +++ b/.github/workflows/ci-linux.yml @@ -15,7 +15,7 @@ env: jobs: gcc-compile-with-make: - runs-on: ubuntu-20.04 # https://github.com/actions/runner-images + runs-on: ubuntu-24.04 # https://github.com/actions/runner-images steps: - uses: actions/checkout@v2 - uses: ./.github/actions/install-essential-dependences @@ -27,7 +27,7 @@ jobs: make -j ${{env.proc_num}} gcc-compile-with-cmake: - runs-on: ubuntu-20.04 + runs-on: ubuntu-24.04 steps: - uses: actions/checkout@v2 - uses: ./.github/actions/install-essential-dependences @@ -43,7 +43,7 @@ jobs: make -j ${{env.proc_num}} gcc-compile-with-bazel: - runs-on: ubuntu-20.04 + runs-on: ubuntu-24.04 steps: - uses: actions/checkout@v2 - name: install dependences @@ -56,7 +56,7 @@ jobs: bazel build -j ${{env.proc_num}} -c opt --copt -DHAVE_ZLIB=1 //... gcc-compile-with-make-all-options: - runs-on: ubuntu-20.04 + runs-on: ubuntu-24.04 steps: - uses: actions/checkout@v2 - uses: ./.github/actions/install-all-dependences @@ -68,7 +68,7 @@ jobs: make -j ${{env.proc_num}} gcc-compile-with-cmake-all-options: - runs-on: ubuntu-20.04 + runs-on: ubuntu-24.04 steps: - uses: actions/checkout@v2 - uses: ./.github/actions/install-all-dependences @@ -84,7 +84,7 @@ jobs: make -j ${{env.proc_num}} gcc-compile-with-bazel-all-options: - runs-on: ubuntu-20.04 + runs-on: ubuntu-24.04 steps: - uses: actions/checkout@v2 - name: install dependences @@ -98,7 +98,7 @@ jobs: clang-compile-with-make: - runs-on: ubuntu-20.04 + runs-on: ubuntu-24.04 steps: - uses: actions/checkout@v2 - uses: ./.github/actions/install-essential-dependences @@ -110,7 +110,7 @@ jobs: make -j ${{env.proc_num}} clang-compile-with-cmake: - runs-on: ubuntu-20.04 + runs-on: ubuntu-24.04 steps: - uses: actions/checkout@v2 - uses: ./.github/actions/install-essential-dependences @@ -126,7 +126,7 @@ jobs: make -j ${{env.proc_num}} clang-compile-with-bazel: - runs-on: ubuntu-20.04 + runs-on: ubuntu-24.04 steps: - uses: actions/checkout@v2 - name: install dependences @@ -139,7 +139,7 @@ jobs: bazel build -j ${{env.proc_num}} -c opt --copt -DHAVE_ZLIB=1 //... clang-compile-with-make-all-options: - runs-on: ubuntu-20.04 + runs-on: ubuntu-24.04 steps: - uses: actions/checkout@v2 - uses: ./.github/actions/install-all-dependences @@ -151,7 +151,7 @@ jobs: make -j ${{env.proc_num}} clang-compile-with-cmake-all-options: - runs-on: ubuntu-20.04 + runs-on: ubuntu-24.04 steps: - uses: actions/checkout@v2 - uses: ./.github/actions/install-all-dependences @@ -167,7 +167,7 @@ jobs: make -j ${{env.proc_num}} clang-compile-with-bazel-all-options: - runs-on: ubuntu-20.04 + runs-on: ubuntu-24.04 steps: - uses: actions/checkout@v2 - name: install dependences @@ -180,7 +180,7 @@ jobs: bazel build -j ${{env.proc_num}} -c opt --define with_mesalink=false --define with_glog=true --define with_thrift=true --copt -DHAVE_ZLIB=1 //... clang-unittest: - runs-on: ubuntu-20.04 + runs-on: ubuntu-24.04 steps: - uses: actions/checkout@v2 - uses: ./.github/actions/install-essential-dependences From d4b6e66da655fcd006d73335703d74ff1ff40983 Mon Sep 17 00:00:00 2001 From: Jerry Zhao Date: Mon, 3 Aug 2026 01:23:54 +0000 Subject: [PATCH 02/12] ci: keep only GCC Linux jobs --- .github/workflows/ci-linux.yml | 103 --------------------------------- 1 file changed, 103 deletions(-) diff --git a/.github/workflows/ci-linux.yml b/.github/workflows/ci-linux.yml index eebecda3..64e669de 100644 --- a/.github/workflows/ci-linux.yml +++ b/.github/workflows/ci-linux.yml @@ -95,106 +95,3 @@ jobs: run: | export CC=gcc && export CXX=g++ bazel build -j 12 -c opt --define with_mesalink=false --define with_glog=true --define with_thrift=true --copt -DHAVE_ZLIB=1 //... - - - clang-compile-with-make: - runs-on: ubuntu-24.04 - steps: - - uses: actions/checkout@v2 - - uses: ./.github/actions/install-essential-dependences - - uses: ./.github/actions/init-make-config - with: - options: --cc=clang --cxx=clang++ - - name: compile - run: | - make -j ${{env.proc_num}} - - clang-compile-with-cmake: - runs-on: ubuntu-24.04 - steps: - - uses: actions/checkout@v2 - - uses: ./.github/actions/install-essential-dependences - - name: cmake - run: | - export CC=clang && export CXX=clang++ - mkdir build - cd build - cmake .. - - name: compile - run: | - cd build - make -j ${{env.proc_num}} - - clang-compile-with-bazel: - runs-on: ubuntu-24.04 - steps: - - uses: actions/checkout@v2 - - name: install dependences - run: | - sudo apt-get update - sudo apt-get install libibverbs-dev - - name: compile - run: | - export CC=clang && export CXX=clang++ - bazel build -j ${{env.proc_num}} -c opt --copt -DHAVE_ZLIB=1 //... - - clang-compile-with-make-all-options: - runs-on: ubuntu-24.04 - steps: - - uses: actions/checkout@v2 - - uses: ./.github/actions/install-all-dependences - - uses: ./.github/actions/init-make-config - with: - options: --cc=clang --cxx=clang++ --with-thrift --with-glog - - name: compile - run: | - make -j ${{env.proc_num}} - - clang-compile-with-cmake-all-options: - runs-on: ubuntu-24.04 - steps: - - uses: actions/checkout@v2 - - uses: ./.github/actions/install-all-dependences - - name: cmake - run: | - export CC=clang && export CXX=clang++ - mkdir build - cd build - cmake -DWITH_MESALINK=OFF -DWITH_GLOG=ON -DWITH_THRIFT=ON .. - - name: compile - run: | - cd build - make -j ${{env.proc_num}} - - clang-compile-with-bazel-all-options: - runs-on: ubuntu-24.04 - steps: - - uses: actions/checkout@v2 - - name: install dependences - run: | - sudo apt-get update - sudo apt-get install libibverbs-dev - - name: compile - run: | - export CC=clang && export CXX=clang++ - bazel build -j ${{env.proc_num}} -c opt --define with_mesalink=false --define with_glog=true --define with_thrift=true --copt -DHAVE_ZLIB=1 //... - - clang-unittest: - runs-on: ubuntu-24.04 - steps: - - uses: actions/checkout@v2 - - uses: ./.github/actions/install-essential-dependences - - name: install gtest - run: | - sudo apt-get install -y cmake libgtest-dev && cd /usr/src/gtest && sudo cmake . && sudo make && sudo mv lib/libgtest* /usr/lib/ - - uses: ./.github/actions/init-make-config - with: - options: --cc=clang --cxx=clang++ - - name: compile tests - run: | - cd test - make -j ${{env.proc_num}} - - name: run tests - run: | - cd test - sh ./run_tests.sh From 2adf1420d138ad432e740ac9cf58f774939f8dbf Mon Sep 17 00:00:00 2001 From: Jerry Zhao Date: Mon, 3 Aug 2026 02:04:44 +0000 Subject: [PATCH 03/12] fix: make GCC unit tests pass on Ubuntu 24.04 Backport the undefined-behavior and E2BIG fixes from upstream brpc commit f58ec398, and restore the unit-test job using GCC. --- .github/workflows/ci-linux.yml | 19 ++++++++++++ src/butil/fast_rand.cpp | 24 +++++++++++---- src/butil/numerics/safe_conversions.h | 25 ++++++++++++++++ .../strings/string_number_conversions.cc | 29 ++----------------- src/butil/strings/stringprintf.cc | 2 +- 5 files changed, 65 insertions(+), 34 deletions(-) diff --git a/.github/workflows/ci-linux.yml b/.github/workflows/ci-linux.yml index 64e669de..1b1cf988 100644 --- a/.github/workflows/ci-linux.yml +++ b/.github/workflows/ci-linux.yml @@ -95,3 +95,22 @@ jobs: run: | export CC=gcc && export CXX=g++ bazel build -j 12 -c opt --define with_mesalink=false --define with_glog=true --define with_thrift=true --copt -DHAVE_ZLIB=1 //... + + gcc-unittest: + runs-on: ubuntu-24.04 + steps: + - uses: actions/checkout@v2 + - uses: ./.github/actions/install-essential-dependences + - name: install gtest + run: sudo apt-get install -y libgtest-dev + - uses: ./.github/actions/init-make-config + with: + options: --cc=gcc --cxx=g++ + - name: compile tests + run: | + cd test + make -j ${{env.proc_num}} + - name: run tests + run: | + cd test + sh ./run_tests.sh diff --git a/src/butil/fast_rand.cpp b/src/butil/fast_rand.cpp index 36e0e831..cef45854 100644 --- a/src/butil/fast_rand.cpp +++ b/src/butil/fast_rand.cpp @@ -23,6 +23,7 @@ #include "butil/macros.h" #include "butil/time.h" // gettimeofday_us() #include "butil/fast_rand.h" +#include "butil/numerics/safe_conversions.h" // safe_abs namespace butil { @@ -110,20 +111,31 @@ int64_t fast_rand_in_64(int64_t min, int64_t max) { if (need_init(_tls_seed)) { init_fast_rand_seed(&_tls_seed); } - if (min >= max) { + if (BAIDU_UNLIKELY(min >= max)) { if (min == max) { return min; } - const int64_t tmp = min; - min = max; - max = tmp; + std::swap(min, max); + } + uint64_t range; + if (min >= 0) { + // Always safe to do subtraction. + range = (uint64_t)(max - min) + 1; + return min + (int64_t)fast_rand_impl(range, &_tls_seed); + } + + uint64_t abs_min = safe_abs(min); + if (max >= 0) { + range = abs_min + (uint64_t)(max) + 1; + } else { + range = abs_min - safe_abs(max) + 1; } - int64_t range = max - min + 1; if (range == 0) { // max = INT64_MAX, min = INT64_MIN return (int64_t)xorshift128_next(&_tls_seed); } - return min + (int64_t)fast_rand_impl(max - min + 1, &_tls_seed); + uint64_t r = fast_rand_impl(range, &_tls_seed); + return r >= abs_min ? (int64_t)(r - abs_min) : -((int64_t)(abs_min - r)); } uint64_t fast_rand_in_u64(uint64_t min, uint64_t max) { diff --git a/src/butil/numerics/safe_conversions.h b/src/butil/numerics/safe_conversions.h index 677aa4af..9a488117 100644 --- a/src/butil/numerics/safe_conversions.h +++ b/src/butil/numerics/safe_conversions.h @@ -58,6 +58,31 @@ inline Dst saturated_cast(Src value) { return static_cast(value); } +inline uint64_t safe_abs(uint64_t x) { + return x; +} + +inline uint64_t safe_abs(int64_t x) { + return (x >= 0) ? (uint64_t)x : ((~(uint64_t)(x)) + 1); +} + +inline uint32_t safe_abs(uint32_t x) { + return x; +} + +inline uint32_t safe_abs(int32_t x) { + return (uint32_t)safe_abs((int64_t)x); +} + +#if defined(__APPLE__) +inline unsigned long safe_abs(unsigned long x) { + return x; +} +inline unsigned long safe_abs(long x) { + return (x >= 0) ? (unsigned long)x : ((~(unsigned long)(x)) + 1); +} +#endif + } // namespace butil #endif // BUTIL_SAFE_CONVERSIONS_H_ diff --git a/src/butil/strings/string_number_conversions.cc b/src/butil/strings/string_number_conversions.cc index 29645dec..bcf3f49c 100644 --- a/src/butil/strings/string_number_conversions.cc +++ b/src/butil/strings/string_number_conversions.cc @@ -12,6 +12,7 @@ #include #include "butil/logging.h" +#include "butil/numerics/safe_conversions.h" // safe_abs #include "butil/scoped_clear_errno.h" #include "butil/strings/utf_string_conversions.h" #include "butil/third_party/dmg_fp/dmg_fp.h" @@ -22,30 +23,6 @@ namespace { template struct IntToStringT { - // This is to avoid a compiler warning about unary minus on unsigned type. - // For example, say you had the following code: - // template - // INT abs(INT value) { return value < 0 ? -value : value; } - // Even though if INT is unsigned, it's impossible for value < 0, so the - // unary minus will never be taken, the compiler will still generate a - // warning. We do a little specialization dance... - template - struct ToUnsignedT {}; - - template - struct ToUnsignedT { - static UINT2 ToUnsigned(INT2 value) { - return static_cast(value); - } - }; - - template - struct ToUnsignedT { - static UINT2 ToUnsigned(INT2 value) { - return static_cast(value < 0 ? -value : value); - } - }; - // This set of templates is very similar to the above templates, but // for testing whether an integer is negative. template @@ -74,9 +51,7 @@ struct IntToStringT { STR outbuf(kOutputBufSize, 0); bool is_neg = TestNegT::TestNeg(value); - // Even though is_neg will never be true when INT is parameterized as - // unsigned, even the presence of the unary operation causes a warning. - UINT res = ToUnsignedT::ToUnsigned(value); + UINT res = safe_abs(value); typename STR::iterator it(outbuf.end()); do { diff --git a/src/butil/strings/stringprintf.cc b/src/butil/strings/stringprintf.cc index 3f40e724..0ca6366c 100644 --- a/src/butil/strings/stringprintf.cc +++ b/src/butil/strings/stringprintf.cc @@ -78,7 +78,7 @@ static void StringAppendVT(StringType* dst, // wrong and no amount of buffer-doubling is going to fix it. return; #else - if (errno != 0 && errno != EOVERFLOW) + if (errno != 0 && errno != EOVERFLOW && errno != E2BIG) return; // Try doubling the buffer size. mem_length *= 2; From c1686b90cce1fdbe100867633503a4caa36ee503 Mon Sep 17 00:00:00 2001 From: Jerry Zhao Date: Mon, 3 Aug 2026 02:17:57 +0000 Subject: [PATCH 04/12] ci: remove macOS builds --- .github/workflows/ci-macos.yml | 58 ---------------------------------- 1 file changed, 58 deletions(-) delete mode 100644 .github/workflows/ci-macos.yml diff --git a/.github/workflows/ci-macos.yml b/.github/workflows/ci-macos.yml deleted file mode 100644 index 4e98aa31..00000000 --- a/.github/workflows/ci-macos.yml +++ /dev/null @@ -1,58 +0,0 @@ -name: Build on Macos - -on: - push: - branches: [ master ] - paths-ignore: - - '**.md' - pull_request: - branches: [ master ] - paths-ignore: - - '**.md' - -env: - proc_num: $(sysctl -n hw.logicalcpu) - -jobs: - compile-with-make: - runs-on: macos-latest # https://github.com/actions/runner-images - - steps: - - uses: actions/checkout@v2 - - - name: install dependences - run: | - brew install ./homebrew-formula/protobuf.rb - brew install openssl gnu-getopt coreutils gflags leveldb - - - name: config_brpc - run: | - GETOPT_PATH=$(find "/usr/local/Cellar/" -name "getopt" -type f -perm +111 -exec dirname {} \;) - export PATH=$GETOPT_PATH:$PATH - ./config_brpc.sh --header="/usr/local/include" --libs="/usr/local/lib" - - - name: compile - run: | - make -j ${{env.proc_num}} - - compile-with-cmake: - runs-on: macos-latest - - steps: - - uses: actions/checkout@v2 - - - name: install dependences - run: | - brew install ./homebrew-formula/protobuf.rb - brew install openssl gnu-getopt coreutils gflags leveldb - - - name: cmake - run: | - mkdir build - cd build - cmake .. - - - name: compile - run: | - cd build - make -j ${{env.proc_num}} From 765451db3fb78749a1d91a9d3a700a9c9c2af6f9 Mon Sep 17 00:00:00 2001 From: Jerry Zhao Date: Mon, 3 Aug 2026 02:47:15 +0000 Subject: [PATCH 05/12] build: use Boost archive download URL --- WORKSPACE | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/WORKSPACE b/WORKSPACE index b6fda836..b67faa72 100644 --- a/WORKSPACE +++ b/WORKSPACE @@ -130,7 +130,7 @@ http_archive( sha256 = "5347464af5b14ac54bb945dc68f1dd7c56f0dad7262816b956138fc53bcc0131", strip_prefix = "boost_1_77_0", urls = [ - "https://boostorg.jfrog.io/artifactory/main/release/1.77.0/source/boost_1_77_0.tar.gz", + "https://archives.boost.io/release/1.77.0/source/boost_1_77_0.tar.gz", ], ) From cc36ff2b5ec4fe96f1ca33260b9ed555636d7d34 Mon Sep 17 00:00:00 2001 From: Jerry Zhao Date: Mon, 3 Aug 2026 03:53:43 +0000 Subject: [PATCH 06/12] test: disable PIE for stack trace symbolization --- test/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/Makefile b/test/Makefile index bff4b436..70914fca 100644 --- a/test/Makefile +++ b/test/Makefile @@ -201,7 +201,7 @@ FORCE: test_butil:$(TEST_BUTIL_OBJS) | libbrpc.dbg.$(SOEXT) @echo "> Linking $@" ifeq ($(SYSTEM),Linux) - $(CXX) -o $@ $(LIBPATHS) $(SOPATHS) -Xlinker "-(" $^ -Xlinker "-)" $(STATIC_LINKINGS) $(UT_DYNAMIC_LINKINGS) + $(CXX) -no-pie -o $@ $(LIBPATHS) $(SOPATHS) -Xlinker "-(" $^ -Xlinker "-)" $(STATIC_LINKINGS) $(UT_DYNAMIC_LINKINGS) else ifeq ($(SYSTEM),Darwin) $(CXX) -o $@ $(LIBPATHS) $(SOPATHS) $^ $(STATIC_LINKINGS) $(UT_DYNAMIC_LINKINGS) endif From 1054e02f6b2ddaa9684ce4ef61eb20cb24ee7efd Mon Sep 17 00:00:00 2001 From: Jerry Zhao Date: Mon, 3 Aug 2026 03:53:56 +0000 Subject: [PATCH 07/12] ci: cancel superseded workflow runs --- .github/workflows/ci-linux.yml | 4 ++++ .github/workflows/license-eyes.yml | 5 +++++ 2 files changed, 9 insertions(+) diff --git a/.github/workflows/ci-linux.yml b/.github/workflows/ci-linux.yml index 1b1cf988..f41d1f9b 100644 --- a/.github/workflows/ci-linux.yml +++ b/.github/workflows/ci-linux.yml @@ -10,6 +10,10 @@ on: paths-ignore: - '**.md' +concurrency: + group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} + cancel-in-progress: true + env: proc_num: $(nproc) diff --git a/.github/workflows/license-eyes.yml b/.github/workflows/license-eyes.yml index 9ae09778..f3453007 100644 --- a/.github/workflows/license-eyes.yml +++ b/.github/workflows/license-eyes.yml @@ -22,6 +22,11 @@ on: push: branches: - master + +concurrency: + group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} + cancel-in-progress: true + jobs: license-check: name: "License Check" From dd5bec3090df76c6c3f63979caf76d5bc1f1057a Mon Sep 17 00:00:00 2001 From: Jerry Zhao Date: Mon, 3 Aug 2026 03:57:43 +0000 Subject: [PATCH 08/12] build: use C++17 for Bazel builds --- .bazelrc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.bazelrc b/.bazelrc index f3d406b0..da245813 100644 --- a/.bazelrc +++ b/.bazelrc @@ -17,7 +17,7 @@ # Default build options. These are applied first and unconditionally. # -build --cxxopt="-std=c++11" +build --cxxopt="-std=c++17" # Use gnu11 for asm keyword. build --conlyopt="-std=gnu11" From 22534ddd774f5ac2dc1d6a43783f1a3ca5c3bd8b Mon Sep 17 00:00:00 2001 From: Jerry Zhao Date: Mon, 3 Aug 2026 04:17:00 +0000 Subject: [PATCH 09/12] test: handle variable DNS result counts --- test/brpc_naming_service_unittest.cpp | 47 ++++++++++++++++----------- 1 file changed, 28 insertions(+), 19 deletions(-) diff --git a/test/brpc_naming_service_unittest.cpp b/test/brpc_naming_service_unittest.cpp index 43ac9f47..0ba2be66 100644 --- a/test/brpc_naming_service_unittest.cpp +++ b/test/brpc_naming_service_unittest.cpp @@ -77,33 +77,42 @@ TEST(NamingServiceTest, sanity) { ASSERT_EQ(0, bns.GetServers("qa-pbrpc.SAT.tjyx", &servers)); #endif + auto collect_ips = [&servers]() { + std::set ret; + for (auto& server : servers) { + ret.insert(server.addr.ip); + } + return ret; + }; brpc::policy::DomainNamingService dns; ASSERT_EQ(0, dns.GetServers("baidu.com:1234", &servers)); - ASSERT_EQ(2u, servers.size()); - ASSERT_EQ(1234, servers[0].addr.port); - ASSERT_EQ(1234, servers[1].addr.port); - const std::set expected_ips{servers[0].addr.ip, servers[1].addr.ip}; + size_t server_size = servers.size(); + ASSERT_GE(server_size, 1); + for (size_t i = 0; i < servers.size(); ++i) { + ASSERT_EQ(1234, servers[i].addr.port); + } + const auto expected_ips = collect_ips(); ASSERT_EQ(0, dns.GetServers("baidu.com", &servers)); - ASSERT_EQ(2u, servers.size()); - const std::set ip_list1{servers[0].addr.ip, servers[1].addr.ip}; - ASSERT_TRUE(IsIPListEqual(expected_ips, ip_list1)); - ASSERT_EQ(80, servers[0].addr.port); - ASSERT_EQ(80, servers[1].addr.port); + ASSERT_EQ(server_size, servers.size()); + ASSERT_TRUE(IsIPListEqual(expected_ips, collect_ips())); + for (size_t i = 0; i < servers.size(); ++i) { + ASSERT_EQ(80, servers[i].addr.port); + } ASSERT_EQ(0, dns.GetServers("baidu.com:1234/useless1/useless2", &servers)); - ASSERT_EQ(2u, servers.size()); - const std::set ip_list2{servers[0].addr.ip, servers[1].addr.ip}; - ASSERT_TRUE(IsIPListEqual(expected_ips, ip_list2)); - ASSERT_EQ(1234, servers[0].addr.port); - ASSERT_EQ(1234, servers[1].addr.port); + ASSERT_EQ(server_size, servers.size()); + ASSERT_TRUE(IsIPListEqual(expected_ips, collect_ips())); + for (size_t i = 0; i < servers.size(); ++i) { + ASSERT_EQ(1234, servers[i].addr.port); + } ASSERT_EQ(0, dns.GetServers("baidu.com/useless1/useless2", &servers)); - ASSERT_EQ(2u, servers.size()); - const std::set ip_list3{servers[0].addr.ip, servers[1].addr.ip}; - ASSERT_TRUE(IsIPListEqual(expected_ips, ip_list3)); - ASSERT_EQ(80, servers[0].addr.port); - ASSERT_EQ(80, servers[1].addr.port); + ASSERT_EQ(server_size, servers.size()); + ASSERT_TRUE(IsIPListEqual(expected_ips, collect_ips())); + for (size_t i = 0; i < servers.size(); ++i) { + ASSERT_EQ(80, servers[i].addr.port); + } const char *address_list[] = { "10.127.0.1:1234", From 2e8fd03728b7b01b46553a5aba6bfeafeff37e40 Mon Sep 17 00:00:00 2001 From: Jerry Zhao Date: Mon, 3 Aug 2026 04:24:47 +0000 Subject: [PATCH 10/12] ci: update checkout action to v7 --- .github/workflows/ci-linux.yml | 14 +++++++------- .github/workflows/license-eyes.yml | 2 +- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/.github/workflows/ci-linux.yml b/.github/workflows/ci-linux.yml index f41d1f9b..1e6f5d98 100644 --- a/.github/workflows/ci-linux.yml +++ b/.github/workflows/ci-linux.yml @@ -21,7 +21,7 @@ jobs: gcc-compile-with-make: runs-on: ubuntu-24.04 # https://github.com/actions/runner-images steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v7 - uses: ./.github/actions/install-essential-dependences - uses: ./.github/actions/init-make-config with: @@ -33,7 +33,7 @@ jobs: gcc-compile-with-cmake: runs-on: ubuntu-24.04 steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v7 - uses: ./.github/actions/install-essential-dependences - name: cmake run: | @@ -49,7 +49,7 @@ jobs: gcc-compile-with-bazel: runs-on: ubuntu-24.04 steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v7 - name: install dependences run: | sudo apt-get update @@ -62,7 +62,7 @@ jobs: gcc-compile-with-make-all-options: runs-on: ubuntu-24.04 steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v7 - uses: ./.github/actions/install-all-dependences - uses: ./.github/actions/init-make-config with: @@ -74,7 +74,7 @@ jobs: gcc-compile-with-cmake-all-options: runs-on: ubuntu-24.04 steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v7 - uses: ./.github/actions/install-all-dependences - name: cmake run: | @@ -90,7 +90,7 @@ jobs: gcc-compile-with-bazel-all-options: runs-on: ubuntu-24.04 steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v7 - name: install dependences run: | sudo apt-get update @@ -103,7 +103,7 @@ jobs: gcc-unittest: runs-on: ubuntu-24.04 steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v7 - uses: ./.github/actions/install-essential-dependences - name: install gtest run: sudo apt-get install -y libgtest-dev diff --git a/.github/workflows/license-eyes.yml b/.github/workflows/license-eyes.yml index f3453007..f408dbaf 100644 --- a/.github/workflows/license-eyes.yml +++ b/.github/workflows/license-eyes.yml @@ -33,7 +33,7 @@ jobs: runs-on: ubuntu-latest steps: - name: "Checkout ${{ github.ref }} ( ${{ github.sha }} )" - uses: actions/checkout@v2 + uses: actions/checkout@v7 - name: Check License uses: apache/skywalking-eyes@v0.4.0 env: From 96c1f67f3399822b05e87c63ef614d0f20744bb6 Mon Sep 17 00:00:00 2001 From: Jerry Zhao Date: Mon, 3 Aug 2026 04:28:46 +0000 Subject: [PATCH 11/12] ci: install gdb for unittest diagnostics --- .github/workflows/ci-linux.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci-linux.yml b/.github/workflows/ci-linux.yml index 1e6f5d98..054b55f6 100644 --- a/.github/workflows/ci-linux.yml +++ b/.github/workflows/ci-linux.yml @@ -105,8 +105,8 @@ jobs: steps: - uses: actions/checkout@v7 - uses: ./.github/actions/install-essential-dependences - - name: install gtest - run: sudo apt-get install -y libgtest-dev + - name: install test dependencies + run: sudo apt-get install -y gdb libgtest-dev - uses: ./.github/actions/init-make-config with: options: --cc=gcc --cxx=g++ From 1340495076a94092b306be5439e3fd38bd3f8f13 Mon Sep 17 00:00:00 2001 From: Jerry Zhao Date: Mon, 3 Aug 2026 04:36:39 +0000 Subject: [PATCH 12/12] ci: refresh apt metadata before installing gdb --- .github/workflows/ci-linux.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/ci-linux.yml b/.github/workflows/ci-linux.yml index 054b55f6..722d633f 100644 --- a/.github/workflows/ci-linux.yml +++ b/.github/workflows/ci-linux.yml @@ -106,7 +106,9 @@ jobs: - uses: actions/checkout@v7 - uses: ./.github/actions/install-essential-dependences - name: install test dependencies - run: sudo apt-get install -y gdb libgtest-dev + run: | + sudo apt-get update + sudo apt-get install -y gdb libgtest-dev - uses: ./.github/actions/init-make-config with: options: --cc=gcc --cxx=g++