Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

test: Add a test for decompression exceeding max receive message size #7938

Merged
merged 5 commits into from
Dec 23, 2024

Conversation

arjan-bal
Copy link
Contributor

@arjan-bal arjan-bal commented Dec 17, 2024

During the review of #7918, it was seen that even if the sender/receiver returns a status.Internal error code instead of status.ResourceExhausted when decompression results in a message exceeding the configured max receive message size, no tests fail. This PR adds a test to catch such regressions in the future.

RELEASE NOTES: N/A

Copy link

codecov bot commented Dec 17, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 82.01%. Comparing base (e8055ea) to head (1bf3afa).
Report is 6 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #7938      +/-   ##
==========================================
- Coverage   82.08%   82.01%   -0.07%     
==========================================
  Files         379      379              
  Lines       38261    38261              
==========================================
- Hits        31406    31381      -25     
- Misses       5551     5569      +18     
- Partials     1304     1311       +7     

see 18 files with indirect coverage changes

@arjan-bal arjan-bal marked this pull request as draft December 17, 2024 19:29
@arjan-bal arjan-bal marked this pull request as ready for review December 17, 2024 19:43
Comment on lines +804 to +806
// Use the name of an existing compressor to avoid interactions with other
// tests since compressors can't be un-registered.
return "gzip"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we use t.Name as the name for the compressor and thereby avoid interactions with other tests?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I tried this earlier, but the clients in the following test pick up the registered compressor and start failing.

func (s) TestClientSupportedCompressors(t *testing.T) {

There's no way to unregister a compressor presently. There is a deprecated WithCompressor that allows using a compressor without registration that I can use.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do you mind filing an issue for us to think about how we can handle this. It is not ideal for one test to influence every test that comes after it.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Opened #7960.

test/compressor_test.go Outdated Show resolved Hide resolved
test/compressor_test.go Outdated Show resolved Hide resolved
test/compressor_test.go Outdated Show resolved Hide resolved
test/compressor_test.go Outdated Show resolved Hide resolved
@easwars easwars assigned arjan-bal and unassigned easwars Dec 17, 2024
@arjan-bal arjan-bal assigned easwars and unassigned arjan-bal Dec 18, 2024
@easwars easwars assigned arjan-bal and unassigned easwars Dec 20, 2024
@arjan-bal arjan-bal merged commit bce0535 into grpc:master Dec 23, 2024
15 checks passed
vinothkumarr227 pushed a commit to vinothkumarr227/grpc-go that referenced this pull request Dec 23, 2024
vinothkumarr227 added a commit to vinothkumarr227/grpc-go that referenced this pull request Dec 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area: RPC Features Includes Compression, Encoding, Attributes/Metadata, Interceptors. Type: Testing
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants