Skip to content

Cannot access a closed Stream on v21.1.2 #1162

Description

@rouke-broersma

Describe the bug
Updating to v21.1.2 causes stream closed exceptions in our unit tests on dispose of the stream after it has already been closed or disposed by (I assume) System.Text.Json. I don't think we are using this wrong, but if I apologize in advance if this is user error.

Exception occurs on dispose after return of this line: https://github.com/stryker-mutator/stryker-net/blob/b7f9ccac7e384b14f7c21321006cbae4261f6d56/src/Stryker.Core/Stryker.Core/Baseline/Providers/DiskBaselineProvider.cs#L38

The stream is not used anywhere after that.

To Reproduce
Steps to reproduce the behavior:
Run unit tests Stryker.Core.UnitTest.Baseline.Providers: stryker-mutator/stryker-net#3100

Expected behavior
Disposing of FileStream should not cause an exception

Additional context

Stream appears to still be open

image

Exception on dispose

image

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    state: needs discussionIssues that need further discussionstate: releasedIssues that are releasedtype: bugIssues that describe misbehaving functionality

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions