Skip to content

Conversation

medhatiwari
Copy link
Contributor

Fix ResponseCompression tests for system zlib compatibility

Fixes #63969

Changes

  • Replace exact byte count assertions with functional decompression verification in CheckResponseCompressed
  • Add CheckCompressionFunctionality method to verify compression by decompressing content
  • Update HTTPS test methods to use appropriate verification based on compression state
  • Handle edge cases: HEAD requests, NoCompression, and SendFileAsync scenarios

Testing

All existing tests pass with both zlib-ng and system zlib implementations.

cc: @giritrivedi

@github-actions github-actions bot added the area-middleware Includes: URL rewrite, redirect, response cache/compression, session, and other general middlewares label Oct 10, 2025
@dotnet-policy-service dotnet-policy-service bot added the community-contribution Indicates that the PR has been added by a community member label Oct 10, 2025
@dotnet-policy-service dotnet-policy-service bot added the pending-ci-rerun When assigned to a PR indicates that the CI checks should be rerun label Oct 17, 2025
@joperezr
Copy link
Member

Thanks a lot for the contribution @medhatiwari! This is a great change and allows us to run our tests against multiple zlib implementations! Ideally we'd want to run the tests in CI against both of those to have coverage and detect regressions but this is a good first step. The tradeoff here of losing brittleness for flexibility feels worth it, especially due to the improvement in correctness coverage.

cc: @BrennanConroy @akoeplinger any other thoughts here or can we go ahead and merge this in?

Copy link
Member

@BrennanConroy BrennanConroy left a comment

Choose a reason for hiding this comment

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

The general idea is good.

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

Labels

area-middleware Includes: URL rewrite, redirect, response cache/compression, session, and other general middlewares community-contribution Indicates that the PR has been added by a community member pending-ci-rerun When assigned to a PR indicates that the CI checks should be rerun

Projects

None yet

Development

Successfully merging this pull request may close these issues.

ResponseCompression tests should verify functionality, not exact compressed byte counts

3 participants