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 {
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
20572059TEST_F (ServerTest, SlowPost) {
You can’t perform that action at this time.
0 commit comments