From 4ba3e12dce1531889b9b39059278a5b6befacf53 Mon Sep 17 00:00:00 2001 From: Bob Chen Date: Sat, 4 Jan 2025 23:08:13 +0800 Subject: [PATCH] a --- common/test/test_throttle.cpp | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/common/test/test_throttle.cpp b/common/test/test_throttle.cpp index e8ac8166..43a9ee03 100644 --- a/common/test/test_throttle.cpp +++ b/common/test/test_throttle.cpp @@ -10,7 +10,7 @@ #include "../../test/gtest.h" #include "../../test/ci-tools.h" -TEST(Throttle, basic) { +/*TEST(Throttle, basic) { // baseline uint64_t total = 10UL * 1024 * 1024; auto start = std::chrono::steady_clock::now(); @@ -108,7 +108,7 @@ TEST(Throttle, pulse) { DEC(duration.count()).comma(true)); 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 +132,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 +163,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 @@ -218,7 +218,7 @@ TEST_P(FindAppropriateSliceNumTest, run) { #define INSTANTIATE_TEST_P INSTANTIATE_TEST_CASE_P #endif -INSTANTIATE_TEST_P(Throttle, +/*INSTANTIATE_TEST_P(Throttle, FindAppropriateSliceNumTest, testing::Values( FindAppropriateSliceNumSuite{10, 0.01}, FindAppropriateSliceNumSuite{50, 0.02}, @@ -226,7 +226,7 @@ INSTANTIATE_TEST_P(Throttle, FindAppropriateSliceNumSuite{500, 0.08}, FindAppropriateSliceNumSuite{1000, 0.08}, FindAppropriateSliceNumSuite{5000, 0.85} // Unacceptable -)); +));*/ //////////////////////////////////////// @@ -253,7 +253,7 @@ class ThrottlePriorityTest : public testing::TestWithParam { }; INSTANTIATE_TEST_P(Throttle, ThrottlePriorityTest, testing::Values( - PriorityTestSuite{ + /*PriorityTestSuite{ // 0. Simulate same priority and equally divide the BW PriorityTestSuite::Simulate, 100'000'000, @@ -297,7 +297,7 @@ INSTANTIATE_TEST_P(Throttle, ThrottlePriorityTest, testing::Values( {200'000'000, 10'000'000, photon::throttle::Priority::Low}, 0.4, 0.55, 0.45, 0.6, - }, + },*/ PriorityTestSuite{ // 5. Real socket. For now there is no way to balance throttle throughput of the same priority. // Maybe we need a WFQ in the future.