Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix test_throttle CI #704

Merged
merged 1 commit into from
Feb 6, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions common/test/test_throttle.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -332,6 +332,7 @@ INSTANTIATE_TEST_P(Throttle, ThrottlePriorityTest, testing::Values(

static void run_real_socket(const std::atomic<bool>& running, const PriorityTestSuite& p,
uint64_t& bw1, uint64_t& bw2) {
photon::semaphore stream_counter;
photon::throttle t(p.limit_bw);
uint64_t buf_size = std::max(p.io1.bs, p.io2.bs);
auto server = photon::net::new_tcp_socket_server();
Expand All @@ -345,6 +346,7 @@ static void run_real_socket(const std::atomic<bool>& running, const PriorityTest
if (ret <= 0) break;
photon::thread_yield();
}
stream_counter.signal(1);
return 0;
};

Expand Down Expand Up @@ -397,6 +399,8 @@ static void run_real_socket(const std::atomic<bool>& running, const PriorityTest

photon::thread_join((photon::join_handle*) client_th1);
photon::thread_join((photon::join_handle*) client_th2);

stream_counter.wait(2);
}

static void run_simulate(const std::atomic<bool>& running, const PriorityTestSuite& p,
Expand Down
Loading