Skip to content

Commit 4c83e71

Browse files
committed
Update
1 parent 8dc6839 commit 4c83e71

File tree

1 file changed

+1
-48
lines changed

1 file changed

+1
-48
lines changed

test/test.cc

Lines changed: 1 addition & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -3174,7 +3174,7 @@ TEST(BenchmarkTest, SimpleGetPerformance) {
31743174
Client cli("localhost", PORT);
31753175

31763176
const int NUM_REQUESTS = 50;
3177-
const int MAX_AVERAGE_MS = 15;
3177+
const int MAX_AVERAGE_MS = 5;
31783178

31793179
auto warmup = cli.Get("/benchmark");
31803180
ASSERT_TRUE(warmup);
@@ -3196,53 +3196,6 @@ TEST(BenchmarkTest, SimpleGetPerformance) {
31963196
EXPECT_LE(avg_ms, MAX_AVERAGE_MS) << "Standalone test too slow: " << avg_ms << "ms (Issue #1777)";
31973197
}
31983198

3199-
TEST(BenchmarkTest, MultiClientConnectionTest) {
3200-
// Test connection overhead with multiple clients (Issue #1777)
3201-
// This helps identify DNS resolution delays and socket creation issues
3202-
3203-
Server svr;
3204-
3205-
svr.Get("/benchmark", [&](const Request & /*req*/, Response &res) {
3206-
res.set_content("OK", "text/plain");
3207-
});
3208-
3209-
auto listen_thread = std::thread([&svr]() { svr.listen("localhost", PORT); });
3210-
auto se = detail::scope_exit([&] {
3211-
svr.stop();
3212-
listen_thread.join();
3213-
ASSERT_FALSE(svr.is_running());
3214-
});
3215-
3216-
svr.wait_until_ready();
3217-
3218-
const int NUM_CLIENTS = 10;
3219-
const int REQUESTS_PER_CLIENT = 5;
3220-
3221-
auto start_total = std::chrono::high_resolution_clock::now();
3222-
3223-
// Test multiple clients each making several requests
3224-
for (int client_id = 0; client_id < NUM_CLIENTS; ++client_id) {
3225-
Client cli("localhost", PORT);
3226-
3227-
for (int req = 0; req < REQUESTS_PER_CLIENT; ++req) {
3228-
auto res = cli.Get("/benchmark");
3229-
ASSERT_TRUE(res) << "Client " << client_id << " request " << req << " failed";
3230-
EXPECT_EQ(StatusCode::OK_200, res->status);
3231-
}
3232-
}
3233-
3234-
auto end_total = std::chrono::high_resolution_clock::now();
3235-
auto total_ms = std::chrono::duration_cast<std::chrono::milliseconds>(end_total - start_total).count();
3236-
auto total_requests = NUM_CLIENTS * REQUESTS_PER_CLIENT;
3237-
double avg_ms = static_cast<double>(total_ms) / total_requests;
3238-
3239-
std::cout << "Multi-client: " << NUM_CLIENTS << " clients x " << REQUESTS_PER_CLIENT
3240-
<< " requests (" << total_requests << " total) in " << total_ms
3241-
<< "ms (avg: " << avg_ms << "ms)" << std::endl;
3242-
3243-
EXPECT_LE(avg_ms, 20.0) << "Multi-client test too slow: " << avg_ms << "ms (Issue #1777)";
3244-
}
3245-
32463199
TEST_F(ServerTest, GetEmptyFile) {
32473200
auto res = cli_.Get("/empty_file");
32483201
ASSERT_TRUE(res);

0 commit comments

Comments
 (0)