aboutsummaryrefslogtreecommitdiffhomepage
path: root/test
diff options
context:
space:
mode:
authorGravatar Vijay Pai <vpai@google.com>2018-03-09 14:41:32 -0800
committerGravatar Vijay Pai <vpai@google.com>2018-03-09 15:15:32 -0800
commitc04c53b38ebbb6879c307c015301f46216828987 (patch)
tree131c598dfd2162f57eba1f4977539ab645f9886c /test
parent2e251697b1991537f463e26afff71a561a732f58 (diff)
Run exception tests 10x to make sure server doesn't crash
Diffstat (limited to 'test')
-rw-r--r--test/cpp/end2end/exception_test.cc24
1 files changed, 14 insertions, 10 deletions
diff --git a/test/cpp/end2end/exception_test.cc b/test/cpp/end2end/exception_test.cc
index 76272ad08a..eb600cebe5 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