Skip to content

Commit

Permalink
fix: make test not flaky (googleapis/google-cloud-cpp-common#143)
Browse files Browse the repository at this point in the history
No need to wait for X milliseconds on the future. We are going to block
on the same future later on the test, that is really what we want to
verify, that the function is called "eventually".
  • Loading branch information
coryan authored Jan 30, 2020
1 parent bcb9a8e commit d6dff1a
Showing 1 changed file with 0 additions and 2 deletions.
2 changes: 0 additions & 2 deletions google/cloud/grpc_utils/completion_queue_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -268,7 +268,6 @@ TEST(CompletionQueueTest, MakeStreamingReadRpc) {
}

TEST(CompletionQueueTest, RunAsync) {
using ms = std::chrono::milliseconds;
CompletionQueue cq;

std::thread runner([&cq] { cq.Run(); });
Expand All @@ -277,7 +276,6 @@ TEST(CompletionQueueTest, RunAsync) {
cq.RunAsync([&done_promise](CompletionQueue&) { done_promise.set_value(); });

auto done = done_promise.get_future();
EXPECT_EQ(std::future_status::ready, done.wait_for(ms(10)));
done.get();

cq.Shutdown();
Expand Down

0 comments on commit d6dff1a

Please sign in to comment.