Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
G
Grpc
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
tci-gateway-module
Grpc
Commits
485cf40a
Commit
485cf40a
authored
8 years ago
by
David Garcia Quintas
Browse files
Options
Downloads
Patches
Plain Diff
Fixed wrong spec and reworked streaming compressed case
parent
20d802db
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
doc/interop-test-descriptions.md
+13
-23
13 additions, 23 deletions
doc/interop-test-descriptions.md
test/cpp/interop/interop_client.cc
+10
-7
10 additions, 7 deletions
test/cpp/interop/interop_client.cc
with
23 additions
and
30 deletions
doc/interop-test-descriptions.md
+
13
−
23
View file @
485cf40a
...
...
@@ -224,7 +224,7 @@ Procedure:
size: 31415
}
response_parameters:{
size:
5
9
size: 9
}
response_parameters:{
size: 2653
...
...
@@ -261,20 +261,19 @@ Procedure:
request_compressed_response: bool
response_type:COMPRESSABLE
response_parameters:{
size: 31415
}
response_parameters:{
size: 59
}
response_parameters:{
size: 2653
size: 31424
}
response_parameters:{
size:
58979
size:
61632
}
}
```
Note that the `response_parameters` sizes are the sum of the usual streaming
response sizes (31415, 9, 2653, 58979) taken in successive pairs. This way,
we only keep a single list of sizes while making sure the individual message
sizes are large enough to trigger compression in all implementations.
Client asserts:
* call was successful
* exactly four responses
...
...
@@ -283,7 +282,7 @@ Procedure:
NOT have the compressed message flag set.
* if `request_compressed_response` is true, the response's messages MUST
have the compressed message flag set.
* response payload bodies are sized (in order): 314
15, 59, 2653, 58979
* response payload bodies are sized (in order): 314
24, 61632
* clients are free to assert that the response payload body contents are
zero and comparing the entire response messages against golden responses
...
...
@@ -295,16 +294,10 @@ Procedure:
request_compressed_response: bool
response_type:UNCOMPRESSABLE
response_parameters:{
size: 31415
}
response_parameters:{
size: 59
}
response_parameters:{
size: 2653
size: 31424
}
response_parameters:{
size:
58979
size:
61632
}
}
```
...
...
@@ -316,10 +309,7 @@ Procedure:
* the response MAY have the compressed message flag set. Some
implementations will choose to compress the payload even when the output
size if larger than the input.
* response payload bodies are sized (in order): 31415, 59, 2653, 58979
* clients are free to assert that the body of the responses are identical to
the golden uncompressable data at `test/cpp/interop/rnd.dat`.
* response payload bodies are sized (in order): 31424, 61632
### ping_pong
...
...
@@ -350,7 +340,7 @@ Procedure:
{
response_type: COMPRESSABLE
response_parameters:{
size:
5
9
size: 9
}
payload:{
body: 8 bytes of zeros
...
...
This diff is collapsed.
Click to expand it.
test/cpp/interop/interop_client.cc
+
10
−
7
View file @
485cf40a
...
...
@@ -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
,
5
9
,
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
();
}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment