From 39c6bad9b364147173fc46ffdda595908d260bf4 Mon Sep 17 00:00:00 2001 From: Bob Chen Date: Sat, 4 Jan 2025 21:37:46 +0800 Subject: [PATCH] a --- .github/workflows/ci.linux.x86_64.yml | 40 +++++++++++++-------------- common/test/test_throttle.cpp | 10 ++++--- 2 files changed, 26 insertions(+), 24 deletions(-) diff --git a/.github/workflows/ci.linux.x86_64.yml b/.github/workflows/ci.linux.x86_64.yml index ba6ab9a4..fc9fcbb9 100644 --- a/.github/workflows/ci.linux.x86_64.yml +++ b/.github/workflows/ci.linux.x86_64.yml @@ -29,23 +29,23 @@ jobs: -D PHOTON_ENABLE_URING=ON \ -D PHOTON_ENABLE_LIBCURL=ON \ -D PHOTON_ENABLE_EXTFS=ON - cmake --build build -j $(nproc) -- VERBOSE=1 + cmake --build build -j $(nproc) - name: Test epoll run: | nohup redis-server & - cd build && ctest -E test-lockfree --timeout 3600 -V + cd build && ctest -R test-throttle --timeout 3600 -V pkill redis-server - name: Test io_uring run: | nohup redis-server & export PHOTON_CI_EV_ENGINE=io_uring - cd build && ctest -E test-lockfree --timeout 3600 -V + cd build && ctest -R test-throttle --timeout 3600 -V pkill redis-server - name: Test epoll_ng run: | nohup redis-server & export PHOTON_CI_EV_ENGINE=epoll_ng - cd build && ctest -E test-lockfree --timeout 3600 -V + cd build && ctest -R test-throttle --timeout 3600 -V pkill redis-server gcc921: @@ -71,23 +71,23 @@ jobs: -D PHOTON_ENABLE_URING=ON \ -D PHOTON_ENABLE_LIBCURL=ON \ -D PHOTON_ENABLE_EXTFS=ON - cmake --build build -j $(nproc) -- VERBOSE=1 + cmake --build build -j $(nproc) - name: Test epoll run: | nohup redis-server & - cd build && ctest -E test-lockfree --timeout 3600 -V + cd build && ctest -R test-throttle --timeout 3600 -V pkill redis-server - name: Test io_uring run: | nohup redis-server & export PHOTON_CI_EV_ENGINE=io_uring - cd build && ctest -E test-lockfree --timeout 3600 -V + cd build && ctest -R test-throttle --timeout 3600 -V pkill redis-server - name: Test epoll_ng run: | nohup redis-server & export PHOTON_CI_EV_ENGINE=epoll_ng - cd build && ctest -E test-lockfree --timeout 3600 -V + cd build && ctest -R test-throttle --timeout 3600 -V pkill redis-server gcc1031: @@ -113,23 +113,23 @@ jobs: -D PHOTON_ENABLE_URING=ON \ -D PHOTON_ENABLE_LIBCURL=ON \ -D PHOTON_ENABLE_EXTFS=ON - cmake --build build -j $(nproc) -- VERBOSE=1 + cmake --build build -j $(nproc) - name: Test epoll run: | nohup redis-server & - cd build && ctest -E test-lockfree --timeout 3600 -V + cd build && ctest -R test-throttle --timeout 3600 -V pkill redis-server - name: Test io_uring run: | nohup redis-server & export PHOTON_CI_EV_ENGINE=io_uring - cd build && ctest -E test-lockfree --timeout 3600 -V + cd build && ctest -R test-throttle --timeout 3600 -V pkill redis-server - name: Test epoll_ng run: | nohup redis-server & export PHOTON_CI_EV_ENGINE=epoll_ng - cd build && ctest -E test-lockfree --timeout 3600 -V + cd build && ctest -R test-throttle --timeout 3600 -V pkill redis-server gcc1121: @@ -155,23 +155,23 @@ jobs: -D PHOTON_ENABLE_URING=ON \ -D PHOTON_ENABLE_LIBCURL=ON \ -D PHOTON_ENABLE_EXTFS=ON - cmake --build build -j $(nproc) -- VERBOSE=1 + cmake --build build -j $(nproc) - name: Test epoll run: | nohup redis-server & - cd build && ctest -E test-lockfree --timeout 3600 -V + cd build && ctest -R test-throttle --timeout 3600 -V pkill redis-server - name: Test io_uring run: | nohup redis-server & export PHOTON_CI_EV_ENGINE=io_uring - cd build && ctest -E test-lockfree --timeout 3600 -V + cd build && ctest -R test-throttle --timeout 3600 -V pkill redis-server - name: Test epoll_ng run: | nohup redis-server & export PHOTON_CI_EV_ENGINE=epoll_ng - cd build && ctest -E test-lockfree --timeout 3600 -V + cd build && ctest -R test-throttle --timeout 3600 -V pkill redis-server gcc1211: @@ -197,23 +197,23 @@ jobs: -D PHOTON_ENABLE_URING=ON \ -D PHOTON_ENABLE_LIBCURL=ON \ -D PHOTON_ENABLE_EXTFS=ON - cmake --build build -j $(nproc) -- VERBOSE=1 + cmake --build build -j $(nproc) - name: Test epoll run: | nohup redis-server & - cd build && ctest -E test-lockfree --timeout 3600 -V + cd build && ctest -R test-throttle --timeout 3600 -V pkill redis-server - name: Test io_uring run: | nohup redis-server & export PHOTON_CI_EV_ENGINE=io_uring - cd build && ctest -E test-lockfree --timeout 3600 -V + cd build && ctest -R test-throttle --timeout 3600 -V pkill redis-server - name: Test epoll_ng run: | nohup redis-server & export PHOTON_CI_EV_ENGINE=epoll_ng - cd build && ctest -E test-lockfree --timeout 3600 -V + cd build && ctest -R test-throttle --timeout 3600 -V pkill redis-server fstack: diff --git a/common/test/test_throttle.cpp b/common/test/test_throttle.cpp index 18ebe18d..bf34328f 100644 --- a/common/test/test_throttle.cpp +++ b/common/test/test_throttle.cpp @@ -10,6 +10,7 @@ #include "../../test/gtest.h" #include "../../test/ci-tools.h" +/* TEST(Throttle, basic) { // baseline uint64_t total = 10UL * 1024 * 1024; @@ -109,6 +110,7 @@ TEST(Throttle, pulse) { EXPECT_GT((uint64_t) duration.count(), 9UL * 1000 * 1000); EXPECT_LT((uint64_t) duration.count(), 20UL * 1000 * 1000); } +*/ template void test_with_idle(IDLE&& idle) { @@ -132,7 +134,7 @@ void test_with_idle(IDLE&& idle) { EXPECT_LT((uint64_t) duration.count(), 2UL * 1000 * 1000); } -TEST(Throttle, no_sleep) { +/*TEST(Throttle, no_sleep) { test_with_idle([] {}); } @@ -163,7 +165,7 @@ TEST(Throttle, try_consume) { LOG_INFO("Act ` times in 10 sec, prevent ` acts", DEC(count).comma(true), DEC(failure).comma(true)); EXPECT_LT(count, 11000UL); -} +}*/ //////////////////////////////////////// // The sleep and semaphore in macOS is less efficient and always cause variance, so skip macOS @@ -252,7 +254,7 @@ struct PriorityTestSuite { class ThrottlePriorityTest : public testing::TestWithParam { }; -INSTANTIATE_TEST_P(Throttle, ThrottlePriorityTest, testing::Values( +/*INSTANTIATE_TEST_P(Throttle, ThrottlePriorityTest, testing::Values( PriorityTestSuite{ // 0. Simulate same priority and equally divide the BW PriorityTestSuite::Simulate, @@ -326,7 +328,7 @@ INSTANTIATE_TEST_P(Throttle, ThrottlePriorityTest, testing::Values( 0.4, 0.6, 0.4, 0.6, } -)); +));*/ static void run_real_socket(const std::atomic& running, const PriorityTestSuite& p, uint64_t& bw1, uint64_t& bw2) {