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

fix: Don't fail the test run if restoring test assemblies fails #2664

Merged
merged 1 commit into from
Sep 15, 2023

Conversation

pentp
Copy link
Contributor

@pentp pentp commented Aug 31, 2023

This is a workaround for a relatively common issue where test assemblies are still in use by Windows Error Reporting (most likely) if there are crashes (e.g., stack overflows). It can be really painful when at the end of a long test run this happens and all results are just thrown away.

Unhandled exception. System.IO.IOException: The process cannot access the file 'C:\_work\1\s\artifacts\bin\Stryker\nnnn\net7.0\nnnn.dll' because it is being used by another process.
   at System.IO.FileSystem.CopyFile(String sourceFullPath, String destFullPath, Boolean overwrite)
   at System.IO.Abstractions.FileWrapper.Copy(String sourceFileName, String destFileName, Boolean overwrite)
   at Stryker.Core.ProjectComponents.TestProjects.TestProjectsInfo.RestoreOriginalAssembly(IAnalyzerResult sourceProject) in /_/src/Stryker.Core/Stryker.Core/ProjectComponents/TestProjects/TestProjectsInfo.cs:line 46
   at Stryker.Core.MutationTest.MutationTestProcess.Restore() in /_/src/Stryker.Core/Stryker.Core/MutationTest/MutationTestProcess.cs:line 105
   at Stryker.Core.StrykerRunner.RunMutationTest(IStrykerInputs inputs, ILoggerFactory loggerFactory, IProjectOrchestrator projectOrchestrator) in /_/src/Stryker.Core/Stryker.Core/StrykerRunner.cs:line 125
   at Stryker.CLI.StrykerCli.RunStryker(IStrykerInputs inputs) in /_/src/Stryker.CLI/Stryker.CLI/StrykerCLI.cs:line 93
   at Stryker.CLI.StrykerCli.<>c__DisplayClass10_0.<Run>b__0() in /_/src/Stryker.CLI/Stryker.CLI/StrykerCLI.cs:line 68
   at McMaster.Extensions.CommandLineUtils.CommandLineApplication.<>c__DisplayClass143_0.<OnExecute>b__0(CancellationToken _)
   at McMaster.Extensions.CommandLineUtils.CommandLineApplication.ExecuteAsync(String[] args, CancellationToken cancellationToken)
   at McMaster.Extensions.CommandLineUtils.CommandLineApplication.Execute(String[] args)
   at Stryker.CLI.StrykerCli.Run(String[] args) in /_/src/Stryker.CLI/Stryker.CLI/StrykerCLI.cs:line 74
   at Stryker.CLI.Program.Main(String[] args) in /_/src/Stryker.CLI/Stryker.CLI/Program.cs:line 14

Copy link
Member

@richardwerkman richardwerkman left a comment

Choose a reason for hiding this comment

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

This is a nice improvement! I'd just like to see some things changed

src/Stryker.Core/Stryker.Core/StrykerRunner.cs Outdated Show resolved Hide resolved
src/Stryker.Core/Stryker.Core/StrykerRunner.cs Outdated Show resolved Hide resolved
@pentp pentp force-pushed the restore-errors branch 2 times, most recently from 6724663 to abc9402 Compare September 4, 2023 11:18
@rouke-broersma rouke-broersma changed the title Don't fail the test run if restoring test assemblies fails fix: Don't fail the test run if restoring test assemblies fails Sep 15, 2023
@rouke-broersma rouke-broersma merged commit 0ba3f77 into stryker-mutator:master Sep 15, 2023
@psfinaki
Copy link
Contributor

Thanks. This was happening for me as well sometimes.

@pentp pentp deleted the restore-errors branch September 18, 2023 22:10
rouke-broersma added a commit that referenced this pull request Oct 13, 2023
* chore(deps): update dependency buildalyzer to v5.0.1 (#2665)

* chore(deps): update dependency buildalyzer to v5.0.1

* Update package lock files

---------

Co-authored-by: Renovatebot <renovatebot@stryker-mutator.io>

* chore: fix page links for site

* fix: Don't fail the test run if restoring test assemblies fails (#2664)

* chore(deps): update xunit-dotnet monorepo to v2.5.1 (#2673)

* chore(deps): update xunit-dotnet monorepo to v2.5.1

* Update package lock files

---------

Co-authored-by: Renovatebot <renovatebot@stryker-mutator.io>

* chore(deps): update dependency yamldotnet to v13.4.0 (#2677)

* chore(deps): update dependency yamldotnet to v13.4.0

* Update package lock files

---------

Co-authored-by: Renovatebot <renovatebot@stryker-mutator.io>

* chore: F# range math (#2679)

* F# range math

* Windows x Linux

* Up

* chore: Passing Stryker options to F# project components (#2680)

Co-authored-by: Rouke Broersma <mobrockers@gmail.com>

* fix: Use solution file when it's available (#2690)

* Use solution file when it's available

* fix unit test

* sonarqube

* chore(compilation): Improve Error and Trace Logging (#2688)

Add logs

Co-authored-by: Rouke Broersma <rouke.broersma@infosupport.com>

* fix: Remove usings from MutantControl (#2694)

chore: remove usings from MutantControl

Co-authored-by: Rouke Broersma <rouke.broersma@infosupport.com>

* chore: Code quality improvements (#2696)

* Use string builder in loop

* Use find & handle other platform newlines

* Use find

* Fix duplicate message

* Add more range tests

* Improve range code

* docs: add SAS configuration (#2676) (#2701)

docs: add SAS configuration

* chore(deps): update dependency launchdarkly.eventsource to v5.1.0 (#2702)

* chore(deps): update dependency launchdarkly.eventsource to v5.1.0

* Update package lock files

---------

Co-authored-by: Renovatebot <renovatebot@stryker-mutator.io>

* chore(deps): update dependency yamldotnet to v13.5.0 (#2703)

* chore(deps): update dependency yamldotnet to v13.5.0

* Update package lock files

---------

Co-authored-by: Renovatebot <renovatebot@stryker-mutator.io>

* chore(deps): update dependency yamldotnet to v13.5.1 (#2704)

* chore(deps): update dependency yamldotnet to v13.5.1

* Update package lock files

---------

Co-authored-by: Renovatebot <renovatebot@stryker-mutator.io>

* chore(deps): update dependency yamldotnet to v13.7.0 (#2705)

* chore(deps): update dependency yamldotnet to v13.7.0

* Update package lock files

---------

Co-authored-by: Renovatebot <renovatebot@stryker-mutator.io>

* chore(deps): update xunit-dotnet monorepo (#2711)

* chore(deps): update xunit-dotnet monorepo

* Update package lock files

---------

Co-authored-by: Renovatebot <renovatebot@stryker-mutator.io>

* chore: Breaking down FilePattern (#2681)

* Simplifying DiffIgnoreChangesInput

* Update FilePattern.cs

* Up

* up

* Rename the class

* up

---------

Co-authored-by: Rouke Broersma <rouke.broersma@infosupport.com>

* chore: Splitting some C# related extensions in a separate file (#2697)

Splitting some C# related extensions in a separate file

Co-authored-by: Rouke Broersma <rouke.broersma@infosupport.com>

* fix: tests for `OpenReportEnabledInput` help text

* fix: typo in re(c)reate

* add: tests for baseline target input.

change: target input default to 'master' to stay consistent with since target input.

---------

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: Renovatebot <renovatebot@stryker-mutator.io>
Co-authored-by: Rouke Broersma <mobrockers@gmail.com>
Co-authored-by: Pent Ploompuu <kaalikas@gmail.com>
Co-authored-by: Petr <psfinaki@users.noreply.github.com>
Co-authored-by: Rouke Broersma <rouke.broersma@infosupport.com>
Co-authored-by: Jack Steel <jacksteel@jacksteel.co.uk>
Co-authored-by: Cyrille DUPUYDAUBY <dupdob@gmail.com>
Co-authored-by: Max S <max.schwerdtner@gmail.com>
richardwerkman pushed a commit that referenced this pull request Oct 13, 2023
* chore(deps): update dependency buildalyzer to v5.0.1 (#2665)

* chore(deps): update dependency buildalyzer to v5.0.1

* Update package lock files

---------

Co-authored-by: Renovatebot <renovatebot@stryker-mutator.io>

* chore: fix page links for site

* fix: Don't fail the test run if restoring test assemblies fails (#2664)

* chore(deps): update xunit-dotnet monorepo to v2.5.1 (#2673)

* chore(deps): update xunit-dotnet monorepo to v2.5.1

* Update package lock files

---------

Co-authored-by: Renovatebot <renovatebot@stryker-mutator.io>

* chore(deps): update dependency yamldotnet to v13.4.0 (#2677)

* chore(deps): update dependency yamldotnet to v13.4.0

* Update package lock files

---------

Co-authored-by: Renovatebot <renovatebot@stryker-mutator.io>

* chore: F# range math (#2679)

* F# range math

* Windows x Linux

* Up

* chore: Passing Stryker options to F# project components (#2680)

Co-authored-by: Rouke Broersma <mobrockers@gmail.com>

* fix: Use solution file when it's available (#2690)

* Use solution file when it's available

* fix unit test

* sonarqube

* chore(compilation): Improve Error and Trace Logging (#2688)

Add logs

Co-authored-by: Rouke Broersma <rouke.broersma@infosupport.com>

* fix: Remove usings from MutantControl (#2694)

chore: remove usings from MutantControl

Co-authored-by: Rouke Broersma <rouke.broersma@infosupport.com>

* chore: Code quality improvements (#2696)

* Use string builder in loop

* Use find & handle other platform newlines

* Use find

* Fix duplicate message

* Add more range tests

* Improve range code

* docs: add SAS configuration (#2676) (#2701)

docs: add SAS configuration

* chore(deps): update dependency launchdarkly.eventsource to v5.1.0 (#2702)

* chore(deps): update dependency launchdarkly.eventsource to v5.1.0

* Update package lock files

---------

Co-authored-by: Renovatebot <renovatebot@stryker-mutator.io>

* chore(deps): update dependency yamldotnet to v13.5.0 (#2703)

* chore(deps): update dependency yamldotnet to v13.5.0

* Update package lock files

---------

Co-authored-by: Renovatebot <renovatebot@stryker-mutator.io>

* chore(deps): update dependency yamldotnet to v13.5.1 (#2704)

* chore(deps): update dependency yamldotnet to v13.5.1

* Update package lock files

---------

Co-authored-by: Renovatebot <renovatebot@stryker-mutator.io>

* chore(deps): update dependency yamldotnet to v13.7.0 (#2705)

* chore(deps): update dependency yamldotnet to v13.7.0

* Update package lock files

---------

Co-authored-by: Renovatebot <renovatebot@stryker-mutator.io>

* chore(deps): update xunit-dotnet monorepo (#2711)

* chore(deps): update xunit-dotnet monorepo

* Update package lock files

---------

Co-authored-by: Renovatebot <renovatebot@stryker-mutator.io>

* chore: Breaking down FilePattern (#2681)

* Simplifying DiffIgnoreChangesInput

* Update FilePattern.cs

* Up

* up

* Rename the class

* up

---------

Co-authored-by: Rouke Broersma <rouke.broersma@infosupport.com>

* chore: Splitting some C# related extensions in a separate file (#2697)

Splitting some C# related extensions in a separate file

Co-authored-by: Rouke Broersma <rouke.broersma@infosupport.com>

* fix: tests for `OpenReportEnabledInput` help text

* fix: typo in re(c)reate

* add: tests for baseline target input.

change: target input default to 'master' to stay consistent with since target input.

* fix: cli info text test

* also check if WithBaselineInput is true

---------

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: Renovatebot <renovatebot@stryker-mutator.io>
Co-authored-by: Rouke Broersma <mobrockers@gmail.com>
Co-authored-by: Pent Ploompuu <kaalikas@gmail.com>
Co-authored-by: Petr <psfinaki@users.noreply.github.com>
Co-authored-by: Rouke Broersma <rouke.broersma@infosupport.com>
Co-authored-by: Jack Steel <jacksteel@jacksteel.co.uk>
Co-authored-by: Cyrille DUPUYDAUBY <dupdob@gmail.com>
Co-authored-by: Max S <max.schwerdtner@gmail.com>
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.

4 participants