Skip to content

Cannot access a closed Stream on v21.1.2 #1162

Closed
@rouke-broersma

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

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