Skip to content

Commit

Permalink
a
Browse files Browse the repository at this point in the history
  • Loading branch information
beef9999 committed Jan 4, 2025
1 parent c0f0ef1 commit 4ba3e12
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions common/test/test_throttle.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down Expand Up @@ -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 <typename IDLE>
void test_with_idle(IDLE&& idle) {
Expand All @@ -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([] {});
}
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -218,15 +218,15 @@ 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},
FindAppropriateSliceNumSuite{100, 0.03},
FindAppropriateSliceNumSuite{500, 0.08},
FindAppropriateSliceNumSuite{1000, 0.08},
FindAppropriateSliceNumSuite{5000, 0.85} // Unacceptable
));
));*/

////////////////////////////////////////

Expand All @@ -253,7 +253,7 @@ class ThrottlePriorityTest : public testing::TestWithParam<PriorityTestSuite> {
};

INSTANTIATE_TEST_P(Throttle, ThrottlePriorityTest, testing::Values(
PriorityTestSuite{
/*PriorityTestSuite{
// 0. Simulate same priority and equally divide the BW
PriorityTestSuite::Simulate,
100'000'000,
Expand Down Expand Up @@ -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.
Expand Down

0 comments on commit 4ba3e12

Please sign in to comment.