File tree Expand file tree Collapse file tree 1 file changed +7
-2
lines changed Expand file tree Collapse file tree 1 file changed +7
-2
lines changed Original file line number Diff line number Diff line change @@ -2867,19 +2867,24 @@ TEST_F(ServerTest, GetStreamedEndless) {
28672867}
28682868
28692869TEST_F (ServerTest, ClientStop) {
2870+ std::atomic_size_t count{4 };
28702871 std::vector<std::thread> threads;
2871- for (auto i = 0 ; i < 3 ; i++) {
2872+
2873+ for (auto i = count.load (); i != 0 ; --i) {
28722874 threads.emplace_back ([&]() {
28732875 auto res = cli_.Get (" /streamed-cancel" ,
28742876 [&](const char *, uint64_t ) { return true ; });
2877+
2878+ --count;
2879+
28752880 ASSERT_TRUE (!res);
28762881 EXPECT_TRUE (res.error () == Error::Canceled ||
28772882 res.error () == Error::Read || res.error () == Error::Write);
28782883 });
28792884 }
28802885
28812886 std::this_thread::sleep_for (std::chrono::seconds (2 ));
2882- while (cli_. is_socket_open () ) {
2887+ while (count != 0 ) {
28832888 cli_.stop ();
28842889 std::this_thread::sleep_for (std::chrono::milliseconds (10 ));
28852890 }
You can’t perform that action at this time.
0 commit comments