Merge pull request #17863 from vjpai/generic_deflake

Deflake a shared CQ usage in a test
reviewable/pr17770/r1^2
Vijay Pai 6 years ago committed by GitHub
commit 0aa0fb6492
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 6
      test/cpp/end2end/generic_end2end_test.cc

@ -17,6 +17,7 @@
*/
#include <memory>
#include <thread>
#include <grpc/grpc.h>
#include <grpc/support/time.h>
@ -219,10 +220,11 @@ TEST_F(GenericEnd2endTest, SequentialUnaryRpcs) {
// Use the same cq as server so that events can be polled in time.
std::unique_ptr<GenericClientAsyncResponseReader> call =
generic_stub_->PrepareUnaryCall(&cli_ctx, kMethodName,
*cli_send_buffer.get(), srv_cq_.get());
*cli_send_buffer.get(), &cli_cq_);
call->StartCall();
ByteBuffer cli_recv_buffer;
call->Finish(&cli_recv_buffer, &recv_status, tag(1));
std::thread client_check([this] { client_ok(1); });
generic_service_.RequestCall(&srv_ctx, &stream, srv_cq_.get(),
srv_cq_.get(), tag(4));
@ -246,7 +248,7 @@ TEST_F(GenericEnd2endTest, SequentialUnaryRpcs) {
stream.Finish(Status::OK, tag(7));
server_ok(7);
verify_ok(srv_cq_.get(), 1, true);
client_check.join();
EXPECT_TRUE(ParseFromByteBuffer(&cli_recv_buffer, &recv_response));
EXPECT_EQ(send_response.message(), recv_response.message());
EXPECT_TRUE(recv_status.ok());

Loading…
Cancel
Save