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 83a6ffb commit 39c6bad
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 24 deletions.
40 changes: 20 additions & 20 deletions .github/workflows/ci.linux.x86_64.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -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:
Expand All @@ -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:
Expand All @@ -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:
Expand All @@ -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:
Expand Down
10 changes: 6 additions & 4 deletions common/test/test_throttle.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
#include "../../test/gtest.h"
#include "../../test/ci-tools.h"

/*
TEST(Throttle, basic) {
// baseline
uint64_t total = 10UL * 1024 * 1024;
Expand Down Expand Up @@ -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 <typename IDLE>
void test_with_idle(IDLE&& idle) {
Expand All @@ -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([] {});
}
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -252,7 +254,7 @@ struct PriorityTestSuite {
class ThrottlePriorityTest : public testing::TestWithParam<PriorityTestSuite> {
};

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,
Expand Down Expand Up @@ -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<bool>& running, const PriorityTestSuite& p,
uint64_t& bw1, uint64_t& bw2) {
Expand Down

0 comments on commit 39c6bad

Please sign in to comment.