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

[release/8.0] Fix ResponseCompressionMiddleware tests #60884

Open
wants to merge 4 commits into
base: release/8.0
Choose a base branch
from

Conversation

wtgodbe
Copy link
Member

@wtgodbe wtgodbe commented Mar 11, 2025

Compression size is no longer guaranteed on Fedora41, so instead check that the size is within a reasonable range (+/- 5)

Fixes #59870

@Copilot Copilot bot review requested due to automatic review settings March 11, 2025 21:28
@wtgodbe wtgodbe requested a review from BrennanConroy as a code owner March 11, 2025 21:28
@dotnet-issue-labeler dotnet-issue-labeler bot added the area-middleware Includes: URL rewrite, redirect, response cache/compression, session, and other general middlewares label Mar 11, 2025

Choose a reason for hiding this comment

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

Pull Request Overview

This PR updates the ResponseCompressionMiddleware tests to account for Fedora41's variable compression sizes by checking that the body length is within a reasonable range.

  • Modified test to use an in-range assertion for ContentLength
  • Retains the original equality assertion which may lead to conflicting behavior
Comments suppressed due to low confidence (1)

src/Middleware/ResponseCompression/test/ResponseCompressionMiddlewareTest.cs:1327

  • The equality assertion conflicts with the new in-range assertion. Consider removing or updating this equality check to avoid failure on Fedora41 where the compression size may vary.
Assert.Equal(expectedBodyLength, response.Content.Headers.ContentLength);
@dotnet-policy-service dotnet-policy-service bot added this to the 8.0.x milestone Mar 11, 2025
Copy link
Contributor

Hi @wtgodbe. If this is not a tell-mode PR, please make sure to follow the instructions laid out in the servicing process document.
Otherwise, please add tell-mode label.

@wtgodbe
Copy link
Member Author

wtgodbe commented Mar 11, 2025

Copy link
Contributor

Looks like this PR hasn't been active for some time and the codebase could have been changed in the meantime.
To make sure no conflicting changes have occurred, please rerun validation before merging. You can do this by leaving an /azp run comment here (requires commit rights), or by simply closing and reopening.

@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 Mar 19, 2025
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 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.

2 participants