File tree Expand file tree Collapse file tree 1 file changed +8
-5
lines changed Expand file tree Collapse file tree 1 file changed +8
-5
lines changed Original file line number Diff line number Diff line change @@ -5167,8 +5167,14 @@ TEST(KeepAliveTest, SSLClientReconnectionPost) {
5167
5167
res.set_content (" Hello World!" , " text/plain" );
5168
5168
});
5169
5169
5170
- auto f = std::async (std::launch::async, [&svr] { svr.listen (HOST, PORT); });
5171
- std::this_thread::sleep_for (std::chrono::milliseconds (200 ));
5170
+ auto listen_thread = std::thread ([&svr] { svr.listen (HOST, PORT); });
5171
+ auto se = detail::scope_exit ([&] {
5172
+ svr.stop ();
5173
+ listen_thread.join ();
5174
+ ASSERT_FALSE (svr.is_running ());
5175
+ });
5176
+
5177
+ svr.wait_until_ready ();
5172
5178
5173
5179
SSLClient cli (HOST, PORT);
5174
5180
cli.enable_server_certificate_verification (false );
@@ -5206,9 +5212,6 @@ TEST(KeepAliveTest, SSLClientReconnectionPost) {
5206
5212
" text/plain" );
5207
5213
ASSERT_TRUE (result);
5208
5214
EXPECT_EQ (200 , result->status );
5209
-
5210
- svr.stop ();
5211
- f.wait ();
5212
5215
}
5213
5216
#endif
5214
5217
You can’t perform that action at this time.
0 commit comments