aboutsummaryrefslogtreecommitdiffhomepage
path: root/test/cpp/end2end
diff options
context:
space:
mode:
authorGravatar Sree Kuchibhotla <sreek@google.com>2016-02-29 18:22:25 -0800
committerGravatar Sree Kuchibhotla <sreek@google.com>2016-02-29 18:22:25 -0800
commit8d543e8e309fb95cc423c19724197ffde2f5dd28 (patch)
tree323f9466e2f08f91f9648e9e509d9324474e78a2 /test/cpp/end2end
parentcff072247eabf1249823590cd6562d542d73f20c (diff)
Fix ResponseStreamServerCancelAfter test flake
Diffstat (limited to 'test/cpp/end2end')
-rw-r--r--test/cpp/end2end/end2end_test.cc13
1 files changed, 9 insertions, 4 deletions
diff --git a/test/cpp/end2end/end2end_test.cc b/test/cpp/end2end/end2end_test.cc
index 42757974b2..dc2c4f6426 100644
--- a/test/cpp/end2end/end2end_test.cc
+++ b/test/cpp/end2end/end2end_test.cc
@@ -437,9 +437,10 @@ class End2endServerTryCancelTest : public End2endTest {
break;
case CANCEL_AFTER_PROCESSING:
- // Server cancelled after writing all messages. Client must have read
- // all messages
- EXPECT_EQ(num_msgs_read, kNumResponseStreamsMsgs);
+ // Even though the Server cancelled after writing all messages, the RPC
+ // may be cancelled before the Client got a chance to read all the
+ // messages.
+ EXPECT_LE(num_msgs_read, kNumResponseStreamsMsgs);
break;
default: {
@@ -519,7 +520,11 @@ class End2endServerTryCancelTest : public End2endTest {
case CANCEL_AFTER_PROCESSING:
EXPECT_EQ(num_msgs_sent, num_messages);
- EXPECT_EQ(num_msgs_read, num_msgs_sent);
+
+ // The Server cancelled after reading the last message and after writing
+ // the message to the client. However, the RPC cancellation might have
+ // taken effect before the client actually read the response.
+ EXPECT_LE(num_msgs_read, num_msgs_sent);
break;
default: