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

System.OutOfMemoryException when generating HTML Report with class with many covered tests #3126

Open
pkunze opened this issue Nov 26, 2024 · 0 comments
Labels
🐛 Bug Something isn't working

Comments

@pkunze
Copy link

pkunze commented Nov 26, 2024

Describe the bug
We having trouble generating the HTML report. We are mutating a class which is covered by a lot of tests.
Now, the generated json file is approx 1.5 GB large and generating the HTML Report fails as can be seen below.

Working around by turning coverage analysis off works, but doesn't really help, since the mutation test will run very long in this case.

Logs

An error occurred during the mutation test run 
System.OutOfMemoryException: Exception of type 'System.OutOfMemoryException' was thrown.
   at System.String.CreateStringFromEncoding(Byte* bytes, Int32 byteLength, Encoding encoding)
   at System.Text.Encoding.GetString(ReadOnlySpan`1 bytes)
   at System.Text.Json.JsonReaderHelper.TranscodeHelper(ReadOnlySpan`1 utf8Unescaped)
   at System.Text.Json.JsonSerializer.WriteString[TValue](TValue& value, JsonTypeInfo`1 jsonTypeInfo)
   at System.Text.Json.JsonSerializer.Serialize[TValue](TValue value, JsonSerializerOptions options)
   at Stryker.Core.Reporters.Json.JsonReportSerialization.ToJson(IJsonReport report) in /_/src/Stryker.Core/Stryker.Core/Reporters/Json/JsonReportSerialization.cs:line 45
   at Stryker.Core.Reporters.Json.JsonReportSerialization.ToJsonHtmlSafe(IJsonReport report) in /_/src/Stryker.Core/Stryker.Core/Reporters/Json/JsonReportSerialization.cs:line 47
   at Stryker.Core.Reporters.Html.HtmlReporter.WriteHtmlReport(String filePath, IReadOnlyProjectComponent reportComponent, ITestProjectsInfo testProjectsInfo) in /_/src/Stryker.Core/Stryker.Core/Reporters/Html/HtmlReporter.cs:line 111
   at Stryker.Core.Reporters.Html.HtmlReporter.OnAllMutantsTested(IReadOnlyProjectComponent reportComponent, ITestProjectsInfo testProjectsInfo) in /_/src/Stryker.Core/Stryker.Core/Reporters/Html/HtmlReporter.cs:line 43
   at Stryker.Core.Reporters.BroadcastReporter.OnAllMutantsTested(IReadOnlyProjectComponent reportComponent, ITestProjectsInfo testProjectsInfo) in /_/src/Stryker.Core/Stryker.Core/Reporters/BroadcastReporter.cs:line 59
   at Stryker.Core.StrykerRunner.RunMutationTest(IStrykerInputs inputs, ILoggerFactory loggerFactory, IProjectOrchestrator projectOrchestrator) in /_/src/Stryker.Core/Stryker.Core/StrykerRunner.cs:line 105

Expected behavior
It would be great if there would be options to work around this without turning test coverage analysis off.
Maybe an option to disable the inclusion of covered tests in the HTML Report would do the job just fine?
Other than that, i have no idea how to solve this.

Desktop

  • OS: Windows 11, Windows Server 2019
  • Type of project: core
  • Framework Version: .NET 8
  • Stryker Version: 4.4.1
@pkunze pkunze added the 🐛 Bug Something isn't working label Nov 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🐛 Bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant