Skip to content

interop: implement client_compressed_unary and server_compressed_unary tests - #9302

Open
om7057 wants to merge 2 commits into
grpc:masterfrom
om7057:interop-compressed-unary-tests
Open

interop: implement client_compressed_unary and server_compressed_unary tests#9302
om7057 wants to merge 2 commits into
grpc:masterfrom
om7057:interop-compressed-unary-tests

Conversation

@om7057

@om7057 om7057 commented Aug 10, 2026

Copy link
Copy Markdown

Updates #1357

What this PR does

Adds the two unary compression interop tests from the interop test specification:

  • client_compressed_unary
  • server_compressed_unary

DoClientCompressedUnaryCall covers the expected request-side behavior: an uncompressed request with expect_compressed=true is rejected with INVALID_ARGUMENT, while correctly compressed and uncompressed requests succeed with the expected response.

DoServerCompressedUnaryCall verifies that the server honors the response_compressed setting when sending the response. The test doesn't inspect the wire-level compression flag because gRPC-Go doesn't currently expose a public per-RPC API for doing so, which the interop specification allows.

On the server side, UnaryCall now checks the request's actual compression via RecvCompress and applies the requested response compressor with SetSendCompressor.

The streaming compression cases are intentionally not included here. They require changing compression on individual messages within a stream, which isn't currently supported by the public API. That work is being tracked in #8662.

Testing

  • go test -cpu 1,4 -timeout 7m ./interop/...
  • ./interop/interop_test.sh
  • Manual end-to-end runs of both new test cases
  • ./scripts/vet.sh

All passed locally.

RELEASE NOTES:

  • interop: Add client_compressed_unary and server_compressed_unary test cases

…y tests

Updates grpc#1357

Adds the two unary compression interop tests from the interop test
descriptions. DoClientCompressedUnaryCall exercises the probe step
(an uncompressed request claiming expect_compressed=true must be
rejected with INVALID_ARGUMENT) followed by correctly compressed and
uncompressed calls. DoServerCompressedUnaryCall exercises the server
honoring response_compressed on outbound messages.

On the server side, UnaryCall now checks the incoming request's
actual compression against ExpectCompressed via the ServerStream's
RecvCompress, and sets the send compressor per ResponseCompressed
via SetSendCompressor.

The two streaming compression tests (client_compressed_streaming,
server_compressed_streaming) are not included here since they need
per-message compression control within a single stream, which is
not yet available in the public API (see grpc#8662).

RELEASE NOTES:
* interop: Add client_compressed_unary and server_compressed_unary interop test cases
@om7057
om7057 force-pushed the interop-compressed-unary-tests branch from 56a53b8 to 0ae72ce Compare August 10, 2026 18:13
@codecov

codecov Bot commented Aug 10, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 83.13%. Comparing base (1ecbd86) to head (d495145).
⚠️ Report is 2 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #9302      +/-   ##
==========================================
+ Coverage   83.11%   83.13%   +0.01%     
==========================================
  Files         423      423              
  Lines       35231    35261      +30     
==========================================
+ Hits        29284    29314      +30     
- Misses       4432     4434       +2     
+ Partials     1515     1513       -2     

see 28 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Updates grpc#1357

Adds interop/compression_test.go, exercising
DoClientCompressedUnaryCall and DoServerCompressedUnaryCall
end-to-end against a real in-process server, following the same
stubserver-based pattern already used by orcalb_test.go. Also adds a
direct assertion that UnaryCall returns INVALID_ARGUMENT when a
request's ExpectCompressed flag doesn't match the actual wire
compression.

RELEASE NOTES: n/a
@easwars
easwars requested a review from mbissa August 10, 2026 18:39
@easwars easwars added Type: Testing Area: Interop Includes vanilla and PSM interop test client and server. Not for bugs from interop testing. labels Aug 10, 2026
@easwars easwars added this to the 1.84 Release milestone Aug 10, 2026
@easwars

easwars commented Aug 10, 2026

Copy link
Copy Markdown
Contributor

@om7057

om7057 commented Aug 10, 2026

Copy link
Copy Markdown
Author

The tests (-race, latest) failure is unrelated to this PR. It fails in google.golang.org/grpc/orca on TestProducerMultipleListeners (a timing assertion, "timed out waiting for reports received"), a package this PR doesn't touch. That test is a known flake tracked in #6637. Would really appreciate a re-run.

@om7057

om7057 commented Aug 17, 2026

Copy link
Copy Markdown
Author

@mbissa just a small reminder on this one!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Area: Interop Includes vanilla and PSM interop test client and server. Not for bugs from interop testing. Type: Testing

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants