This repository has been archived by the owner on Apr 20, 2023. It is now read-only.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
Set AllowFailureWithoutError to prevent the error MSB4181 from being output.
MSB4181: The "Microsoft.TestPlatform.Build.Tasks.VSTestTask" task returned false but did not log an error.
This error is caused by VSTest outputting errors directly to the screen instead of using MSBuild, and is blocking some builds from finishing. The same fix was done in net5.0.
There is no workaround, other than sticking with 3.1.302 SDK.
Those are the changes included in the update:
microsoft/vstest@4f345e9
microsoft/vstest@d8b5912
The option is set to "false" because the version of MSBuild that is being used has the option implemented backwards. This issue was reported to MSBuild and will be fixed in 16.9.
Customer Impact
Anyone who updated their 3.1 SDK from "3.1.302" to a newer version is impacted by this. Any failing test will make the VSTest MSBuild task fail and the build will fail with a confusing message. This makes the CI failures harder to diagnose, because the first error that you see is the MSBuild error, instead of the "x tests failed" error.
Regression?
There was a change of behavior in MSBuild https://github.com/dotnet/msbuild/blob/ca44138662e3aa90eb9305dd31d906ef02e962cb/src/Build/BackEnd/Components/RequestBuilder/TaskBuilder.cs#L940-L958 that started showing this error for all tasks that return false but write their errors to screen in non standard way. VSTest is one of them, we write directly to screen because we want to have colors in our output to easily distinguish passed and failed tests.
Risk (see taxonomy)
Very low. The change is limited to dotnet test. Tests can finish running with or without this change in place. Only the reporting of failed test results is affected.
Link the PR to the original issue and/or the PR to master.
Fix dotnet/sdk#13431
Packaging impact? (if a libraries change)
I am not aware of any.