File tree Expand file tree Collapse file tree 1 file changed +5
-3
lines changed Expand file tree Collapse file tree 1 file changed +5
-3
lines changed Original file line number Diff line number Diff line change @@ -1333,8 +1333,11 @@ class ServerTest : public ::testing::Test {
1333
1333
1334
1334
virtual void TearDown () {
1335
1335
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
+ }
1338
1341
}
1339
1342
t_.join ();
1340
1343
}
@@ -2051,7 +2054,6 @@ TEST_F(ServerTest, SlowRequest) {
2051
2054
std::thread ([=]() { auto res = cli_.Get (" /slow" ); }));
2052
2055
request_threads_.push_back (
2053
2056
std::thread ([=]() { auto res = cli_.Get (" /slow" ); }));
2054
- std::this_thread::sleep_for (std::chrono::milliseconds (100 ));
2055
2057
}
2056
2058
2057
2059
TEST_F (ServerTest, SlowPost) {
You can’t perform that action at this time.
0 commit comments