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

Improve PipeWriterTests.CompleteWithLargeWriteThrows #65506

Merged
merged 3 commits into from
Feb 18, 2022

Conversation

akoeplinger
Copy link
Member

Allocate the buffer outside of the loop so we don't hit OOM issues.

While looking at the test I noticed that it actually had a bug too:
Nothing was asserting that we indeed throw an InvalidOperationException when the writer is completed. Adding Assert.ThrowsAsync revealed that the current loop iteration count was too low to hit the exception reliably
within the 10ms delay so instead check for the execution time.

Fixes #64930

Allocate the buffer outside of the loop so we don't hit OOM issues.

While looking at the test I noticed that it actually had a bug too:
Nothing was asserting that we indeed throw an InvalidOperationException
when the writer is completed. Adding `Assert.ThrowsAsync` revealed that
the current loop iteration count was too low to hit the exception reliably
within the 10ms delay so instead check for the execution time.

Fixes dotnet#64930
@akoeplinger
Copy link
Member Author

/azp run runtime-extra-platforms

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@akoeplinger
Copy link
Member Author

/azp run runtime-extra-platforms

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@akoeplinger
Copy link
Member Author

/azp run runtime-extra-platforms

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@akoeplinger akoeplinger merged commit 3deadcf into dotnet:main Feb 18, 2022
@akoeplinger akoeplinger deleted the fix-pipewriter-test branch February 18, 2022 13:46
@ghost ghost locked as resolved and limited conversation to collaborators Mar 20, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[tvOS] OutOfMemoryException in System.IO.Pipelines.Tests.PipeWriterTests.CompleteWithLargeWriteThrows
2 participants