Skip to content

Fix HttpSys Caching_SendFileWithFullContentLength_Cached test #4630

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

Merged
merged 1 commit into from
Dec 13, 2018

Conversation

Tratcher
Copy link
Member

https://github.com/aspnet/AspNetCore-Internal/issues/1500

The test was picking the first file from the local directory and using it as test content. For netcoreapp2 this was Microsoft.AspNetCore.Server.HttpSys.dll, but for net461 it was Castle.Core.dll. Castle was much larger so it caused different behavior and failed the net461 tests.

@Tratcher Tratcher self-assigned this Dec 12, 2018
@Tratcher Tratcher requested review from JunTaoLuo and muratg December 12, 2018 23:46
@@ -21,7 +21,7 @@ public class ResponseCachingTests

public ResponseCachingTests()
{
_absoluteFilePath = Directory.GetFiles(Directory.GetCurrentDirectory()).First();
_absoluteFilePath = Path.Combine(Directory.GetCurrentDirectory(), "Microsoft.AspNetCore.Server.HttpSys.dll");
Copy link
Contributor

Choose a reason for hiding this comment

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

Hmm, why not a test specific text file that we include as content? That would probably be more stable.

Copy link
Member Author

Choose a reason for hiding this comment

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

shrug when we're not interested in the contents of the file then any file will do.

Copy link
Contributor

Choose a reason for hiding this comment

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

That was probably the reasoning behind .First() but apparently that can cause issues.

Copy link
Contributor

@JunTaoLuo JunTaoLuo left a comment

Choose a reason for hiding this comment

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

This change is fine though I prefer a small static .txt file instead.

@Tratcher Tratcher merged commit a3c9902 into release/2.1 Dec 13, 2018
@Tratcher Tratcher deleted the tratcher/files21 branch December 13, 2018 01:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants