Skip to content

Commit 559c407

Browse files
committed
Adjusted SlowRequest test
1 parent a2f4e29 commit 559c407

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

test/test.cc

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1333,8 +1333,11 @@ class ServerTest : public ::testing::Test {
13331333

13341334
virtual void TearDown() {
13351335
svr_.stop();
1336-
for (auto &t : request_threads_) {
1337-
t.join();
1336+
if (!request_threads_.empty()) {
1337+
std::this_thread::sleep_for(std::chrono::seconds(1));
1338+
for (auto &t : request_threads_) {
1339+
t.join();
1340+
}
13381341
}
13391342
t_.join();
13401343
}
@@ -2051,7 +2054,6 @@ TEST_F(ServerTest, SlowRequest) {
20512054
std::thread([=]() { auto res = cli_.Get("/slow"); }));
20522055
request_threads_.push_back(
20532056
std::thread([=]() { auto res = cli_.Get("/slow"); }));
2054-
std::this_thread::sleep_for(std::chrono::milliseconds(100));
20552057
}
20562058

20572059
TEST_F(ServerTest, SlowPost) {

0 commit comments

Comments
 (0)