Skip to content

Commit

Permalink
Merge pull request grpc#7152 from nathanielmanistaatgoogle/interop
Browse files Browse the repository at this point in the history
Fix Python server interop spec noncompliance
  • Loading branch information
jtattermusch authored Jun 30, 2016
2 parents 0a5d60c + 458b35a commit dc733d6
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 8 deletions.
8 changes: 4 additions & 4 deletions doc/interop-test-descriptions.md
Original file line number Diff line number Diff line change
Expand Up @@ -968,17 +968,17 @@ request payload bodies received.
[StreamingOutputCall]: #streamingoutputcall
Server implements StreamingOutputCall by replying, in order, with one
StreamingOutputCallResponses for each ResponseParameters in
StreamingOutputCallRequest. Each StreamingOutputCallResponses should have a
StreamingOutputCallResponse for each ResponseParameters in
StreamingOutputCallRequest. Each StreamingOutputCallResponse should have a
payload body of size ResponseParameters.size bytes, as specified by its
respective ResponseParameters. After sending all responses, it closes with OK.
### FullDuplexCall
[FullDuplexCall]: #fullduplexcall
Server implements FullDuplexCall by replying, in order, with one
StreamingOutputCallResponses for each ResponseParameters in each
StreamingOutputCallRequest. Each StreamingOutputCallResponses should have a
StreamingOutputCallResponse for each ResponseParameters in each
StreamingOutputCallRequest. Each StreamingOutputCallResponse should have a
payload body of size ResponseParameters.size bytes, as specified by its
respective ResponseParameters. After receiving half close and sending all
responses, it closes with OK.
Expand Down
9 changes: 5 additions & 4 deletions src/python/grpcio/tests/interop/methods.py
Original file line number Diff line number Diff line change
Expand Up @@ -79,10 +79,11 @@ def StreamingInputCall(self, request_iterator, context):

def FullDuplexCall(self, request_iterator, context):
for request in request_iterator:
yield messages_pb2.StreamingOutputCallResponse(
payload=messages_pb2.Payload(
type=request.payload.type,
body=b'\x00' * request.response_parameters[0].size))
for response_parameters in request.response_parameters:
yield messages_pb2.StreamingOutputCallResponse(
payload=messages_pb2.Payload(
type=request.payload.type,
body=b'\x00' * response_parameters.size))

# NOTE(nathaniel): Apparently this is the same as the full-duplex call?
# NOTE(atash): It isn't even called in the interop spec (Oct 22 2015)...
Expand Down

0 comments on commit dc733d6

Please sign in to comment.