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

dotnet.exe crashes when called from vstest.console.exe on .NET Core 2.2 #1869

Closed
Ausm opened this issue Dec 12, 2018 · 7 comments
Closed

dotnet.exe crashes when called from vstest.console.exe on .NET Core 2.2 #1869

Ausm opened this issue Dec 12, 2018 · 7 comments
Assignees
Labels

Comments

@Ausm
Copy link

Ausm commented Dec 12, 2018

Description

I try to get my build working which uses a "Visual Studio Test" Task to execute tests in a test project (MSTest).
That build runs on a build server that has VS Build Tools and VS Test Agent installed.
When I run:
& "C:\Program Files (x86)\Microsoft Visual Studio\2017\TestAgent\Common7\IDE\CommonExtensions\Microsoft\TestWindow\vstest.console.exe" D:\S\4\s\test\Project.Test\bin\release\netcoreapp2.2\Project.Test.dll /Settings:D:\S\_temp\1b091bf0-fe0a-11e8-996b-6798074e2821.runsettings /EnableCodeCoverage /logger:trx "/TestAdapterPath:\"D:\S\4\s\""
It runs into a timeout, and dotnet.exe crashes with the following message:
dotnet.exe crash message

On my Dev computer with Visual Studio 2017 installed, everything works fine.
The problem seems to be the \EnableCodeCoverage switch. If I remove that, everything works, but then I don't have a code coverage report :(

Steps to reproduce

  1. Start with a clean W2012
  2. Install Visual Studio Test Agent 2017
  3. Install Visual Studio Build Tools 2017
  4. Install .Net Core 2.2.100 SDK
  5. Update Test Agent and Build Agent both to v15.9.4
  6. Create a simple Class library (netstandard2.0) and a MSTest project (netcore2.2)
    A test project where the error occured: TestCore22Issue.zip
  7. Execute the above stated command

Expected behavior

To execute tests and create trx and codecoverage file.

Actual behavior

dotnet.exe crashes.

Diagnostic logs

Console output of the build process.

PS D:\Test\TestCore22Issue\TestCore22Issue> dotnet build -c release
Microsoft (R) Build Engine version 15.9.20+g88f5fadfbe for .NET Core
Copyright (C) Microsoft Corporation. All rights reserved.

  Restoring packages for D:\Test\TestCore22Issue\TestCore22Issue\test\TestProject\TestProject.csproj...
  Restoring packages for D:\Test\TestCore22Issue\TestCore22Issue\src\ClassLibrary\ClassLibrary.csproj...
  Generating MSBuild file D:\Test\TestCore22Issue\TestCore22Issue\src\ClassLibrary\obj\ClassLibrary.csproj.nuget.g.props.
  Generating MSBuild file D:\Test\TestCore22Issue\TestCore22Issue\src\ClassLibrary\obj\ClassLibrary.csproj.nuget.g.targets.
  Restore completed in 198.36 ms for D:\Test\TestCore22Issue\TestCore22Issue\src\ClassLibrary\ClassLibrary.csproj.
  Generating MSBuild file D:\Test\TestCore22Issue\TestCore22Issue\test\TestProject\obj\TestProject.csproj.nuget.g.props.

  Generating MSBuild file D:\Test\TestCore22Issue\TestCore22Issue\test\TestProject\obj\TestProject.csproj.nuget.g.targets.
  Restore completed in 809.66 ms for D:\Test\TestCore22Issue\TestCore22Issue\test\TestProject\TestProject.csproj.
  ClassLibrary -> D:\Test\TestCore22Issue\TestCore22Issue\src\ClassLibrary\bin\Release\netstandard2.0\ClassLibrary.dll
  TestProject -> D:\Test\TestCore22Issue\TestCore22Issue\test\TestProject\bin\Release\netcoreapp2.2\TestProject.dll

Build succeeded.
    0 Warning(s)
    0 Error(s)

Time Elapsed 00:00:06.22
PS D:\Test\TestCore22Issue\TestCore22Issue> & "C:\Program Files (x86)\Microsoft Visual Studio\2017\TestAgent\Common7\IDE\CommonExtensions\Microsoft\TestWindow\vstest.console.exe" D:\Test\TestCore22Issue\TestCore22Issue\test\TestProject\bin\Release\netcoreapp2.2\TestProject.dll /Settings:D:\Test\TestCore22Issue\1b091bf0-fe0a-11e8-996b-6798074e2821.runsettings /logger:trx "/TestAdapterPath:`"D:\S\4\s`""
Microsoft (R) Test Execution Command Line Tool Version 15.9.0
Copyright (c) Microsoft Corporation.  All rights reserved.

Starting test execution, please wait...
Passed   TestMethod1
Results File: D:\Test\TestCore22Issue\TestCore22Issue\TestResults\Administrator_ATS-TFSBUILD03_2018-12-13_10_23_13.trx

Total tests: 1. Passed: 1. Failed: 0. Skipped: 0.
Test Run Successful.
Test execution time: 1.8540 Seconds
PS D:\Test\TestCore22Issue\TestCore22Issue> & "C:\Program Files (x86)\Microsoft Visual Studio\2017\TestAgent\Common7\IDE\CommonExtensions\Microsoft\TestWindow\vstest.console.exe" D:\Test\TestCore22Issue\TestCore22Issue\test\TestProject\bin\Release\netcoreapp2.2\TestProject.dll /Settings:D:\Test\TestCore22Issue\1b091bf0-fe0a-11e8-996b-6798074e2821.runsettings /EnableCodeCoverage /logger:trx "/TestAdapterPath:`"D:\S\4\s`""
Microsoft (R) Test Execution Command Line Tool Version 15.9.0
Copyright (c) Microsoft Corporation.  All rights reserved.

Starting test execution, please wait...
vstest.console process failed to connect to testhost process after 90 seconds. This may occur due to machine slowness, p
lease set environment variable VSTEST_CONNECTION_TIMEOUT to increase timeout.
Results File: D:\Test\TestCore22Issue\TestCore22Issue\TestResults\Administrator_ATS-TFSBUILD03_2018-12-13_10_25_11.trx

Attachments:
  D:\Test\TestCore22Issue\TestCore22Issue\TestResults\fa4d7e96-c014-426c-8000-0a20d1ecd765\Administrator_ATS-TFSBUILD03
2018-12-13 10_23_40.coverage

Test Run Aborted.
PS D:\Test\TestCore22Issue\TestCore22Issue>

Environment

  • OS: W2012
  • vstest.console.exe version: 15.0.28218.60
  • VS Test Agent version: 15.9.4
  • VS Build Tools version: 15.9.4
  • .Net Core SDK: 2.2.100
@Ausm
Copy link
Author

Ausm commented Dec 12, 2018

Maybe related to #859
Similar behavior, but they say they fixed it in VS 15.3.

@singhsarab
Copy link
Contributor

@Ausm You mean /enablecodecoverage right ?

@singhsarab singhsarab self-assigned this Dec 13, 2018
@Ausm
Copy link
Author

Ausm commented Dec 13, 2018

@singhsarab Yes, u r right, typo from me... ;)

@mayankbansal018
Copy link
Contributor

@Ausm just to confirm it seems you are using win 2012 server machine? Can you please try following runsettings mentioned at https://github.com/Microsoft/vstest/blob/master/src/DataCollectors/TraceDataCollector/VanguardCollector/DefaultCodeCoverageConfig.xml

use /settings:DefaultCodeCoverageConfig.settings instead of /EnableCodeCoverage

@Ausm
Copy link
Author

Ausm commented Dec 13, 2018

Yes, I'm running it on a Win 2012 server machine.
You mean I should put that xml config into a runsettings DataCollector tag, to have a runsettingsfile that looks like this, right?

@Ausm
Copy link
Author

Ausm commented Dec 13, 2018

Did so and it works... even if I keep /EnableCodeCoverage.

@mayankbansal018
Copy link
Contributor

/EnableCodeCoverage option gets overshadowed since you are passing the same thing via settings file created above.

This is a known issue on Win 8 based OS, which doesn't happen on recent Win10 based OS

Glad to know that the issue is resolved for you. I'll close this issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants