diff options
author | 2018-03-09 16:42:24 -0800 | |
---|---|---|
committer | 2018-03-09 16:42:24 -0800 | |
commit | a7f52a62baa9f9008e7a217f24006c10ce81ed9c (patch) | |
tree | 4f596ca3dbbde06cbcf65d799f106778127d265f /test | |
parent | c50ded274c80d276a614763f054ce5efb2165351 (diff) | |
parent | c04c53b38ebbb6879c307c015301f46216828987 (diff) |
Merge pull request #14660 from vjpai/exception_10x
Run exception tests 10x to make sure server doesn't crash
Diffstat (limited to 'test')
-rw-r--r-- | test/cpp/end2end/exception_test.cc | 24 |
1 files changed, 14 insertions, 10 deletions
diff --git a/test/cpp/end2end/exception_test.cc b/test/cpp/end2end/exception_test.cc index 76916d3a0d..5343997663 100644 --- a/test/cpp/end2end/exception_test.cc +++ b/test/cpp/end2end/exception_test.cc @@ -87,24 +87,28 @@ TEST_F(ExceptionTest, Unary) { EchoRequest request; EchoResponse response; request.set_message("test"); - ClientContext context; - Status s = stub_->Echo(&context, request, &response); - EXPECT_FALSE(s.ok()); - EXPECT_EQ(s.error_code(), StatusCode::UNKNOWN); + for (int i = 0; i < 10; i++) { + ClientContext context; + Status s = stub_->Echo(&context, request, &response); + EXPECT_FALSE(s.ok()); + EXPECT_EQ(s.error_code(), StatusCode::UNKNOWN); + } } TEST_F(ExceptionTest, RequestStream) { ResetStub(); EchoResponse response; - ClientContext context; - auto stream = stub_->RequestStream(&context, &response); - stream->WritesDone(); - Status s = stream->Finish(); + for (int i = 0; i < 10; i++) { + ClientContext context; + auto stream = stub_->RequestStream(&context, &response); + stream->WritesDone(); + Status s = stream->Finish(); - EXPECT_FALSE(s.ok()); - EXPECT_EQ(s.error_code(), StatusCode::UNKNOWN); + EXPECT_FALSE(s.ok()); + EXPECT_EQ(s.error_code(), StatusCode::UNKNOWN); + } } #endif // GRPC_ALLOW_EXCEPTIONS |