aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorGravatar chenw <chenw@google.com>2014-12-16 14:20:44 -0800
committerGravatar Nicolas Noble <nnoble@google.com>2014-12-16 17:20:09 -0800
commit69ca59fa74add51e03153b1f346783c70cc826ba (patch)
tree476057475ae45553652256c32c952001b6339752
parent769b70ba9d10205d9bfda77bf4420e60ca8d83ba (diff)
Add slow client consumer test case for flow control test.
The client will sleep 500 milliseconds before read next message in reponse streaming. Change on 2014/12/16 by chenw <chenw@google.com> ------------- Created by MOE: http://code.google.com/p/moe-java MOE_MIGRATED_REVID=82265748
-rw-r--r--test/cpp/interop/client.cc7
1 files changed, 7 insertions, 0 deletions
diff --git a/test/cpp/interop/client.cc b/test/cpp/interop/client.cc
index d447738734..a2a0f582f9 100644
--- a/test/cpp/interop/client.cc
+++ b/test/cpp/interop/client.cc
@@ -32,8 +32,10 @@
*/
+#include <chrono>
#include <memory>
#include <string>
+#include <thread>
#include <grpc/grpc.h>
#include <grpc/support/log.h>
@@ -57,6 +59,8 @@ DEFINE_string(test_case, "large_unary",
"large_unary : single request and (large) response; "
"client_streaming : request streaming with single response; "
"server_streaming : single request with response streaming; "
+ "slow_consumer : single request with response"
+ " streaming with slow client consumer; "
"half_duplex : half-duplex streaming;"
"ping_pong : full-duplex streaming;"
"all : all of above.");
@@ -78,6 +82,9 @@ namespace {
// The same value is defined by the Java client.
const std::vector<int> request_stream_sizes = {27182, 8, 1828, 45904};
const std::vector<int> response_stream_sizes = {31415, 9, 2653, 58979};
+const int kNumResponseMessages = 2000;
+const int kResponseMessageSize = 1030;
+const int kReceiveDelayMilliSeconds = 20;
} // namespace
std::shared_ptr<ChannelInterface> CreateTestChannel(