aboutsummaryrefslogtreecommitdiffhomepage
path: root/test/cpp/interop
diff options
context:
space:
mode:
authorGravatar David Garcia Quintas <dgq@google.com>2016-06-08 13:35:25 -0700
committerGravatar David Garcia Quintas <dgq@google.com>2016-06-08 13:35:25 -0700
commit485cf40ab7d68b2624a5ab3be3842444f5835f14 (patch)
tree858cd5bd7c0a4e8cc84dafd3e651db4fed396759 /test/cpp/interop
parent20d802db98fc8aba78169567415b003a85b55b84 (diff)
Fixed wrong spec and reworked streaming compressed case
Diffstat (limited to 'test/cpp/interop')
-rw-r--r--test/cpp/interop/interop_client.cc17
1 files changed, 10 insertions, 7 deletions
diff --git a/test/cpp/interop/interop_client.cc b/test/cpp/interop/interop_client.cc
index a0479e8f68..7705bb1592 100644
--- a/test/cpp/interop/interop_client.cc
+++ b/test/cpp/interop/interop_client.cc
@@ -58,7 +58,7 @@ namespace testing {
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, 59, 2653, 58979};
+const std::vector<int> response_stream_sizes = {31415, 9, 2653, 58979};
const int kNumResponseMessages = 2000;
const int kResponseMessageSize = 1030;
const int kReceiveDelayMilliSeconds = 20;
@@ -466,10 +466,11 @@ bool InteropClient::DoResponseCompressedStreaming() {
request.set_response_type(payload_types[i]);
request.set_request_compressed_response(request_compression[j]);
- for (size_t k = 0; k < response_stream_sizes.size(); ++k) {
+ for (size_t k = 0; k < response_stream_sizes.size() / 2; ++k) {
ResponseParameters* response_parameter =
request.add_response_parameters();
- response_parameter->set_size(response_stream_sizes[k]);
+ response_parameter->set_size(response_stream_sizes[k] +
+ response_stream_sizes[k + 1]);
}
StreamingOutputCallResponse response;
@@ -483,7 +484,9 @@ bool InteropClient::DoResponseCompressedStreaming() {
switch (response.payload().type()) {
case PayloadType::COMPRESSABLE:
GPR_ASSERT(response.payload().body() ==
- grpc::string(response_stream_sizes[k], '\0'));
+ grpc::string(response_stream_sizes[k] +
+ response_stream_sizes[k + 1],
+ '\0'));
break;
case PayloadType::UNCOMPRESSABLE:
break;
@@ -513,14 +516,14 @@ bool InteropClient::DoResponseCompressedStreaming() {
gpr_log(GPR_DEBUG, "Response streaming done %s.", log_suffix);
gpr_free(log_suffix);
- if (k < response_stream_sizes.size()) {
+ if (k < response_stream_sizes.size() / 2) {
// stream->Read() failed before reading all the expected messages. This
// is most likely due to a connection failure.
gpr_log(GPR_ERROR,
"DoResponseCompressedStreaming(): Responses read (k=%d) is "
"less than the expected messages (i.e "
- "response_stream_sizes.size() (%d)). (i=%d, j=%d)",
- k, response_stream_sizes.size(), i, j);
+ "response_stream_sizes.size()/2 (%d)). (i=%d, j=%d)",
+ k, response_stream_sizes.size() / 2, i, j);
return TransientFailureOrAbort();
}