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
VsTest hangs (v.15.6.0) or fails immediately (v.16.1.0) in Azure DevOps Release Pipeline #2022
Comments
Any news? |
Hi @scale-tone, let me look into this. |
Quick thing for you to try, can you set it to 600000 and then give it a shot. I'm suspecting a "unit of time" issue |
Nice try, but no luck:
Besides, it wouldn't explain the difference in behavior between versions. |
@scale-tone we tried it out on the hosted agent, setting it to 600, then 10. It worked fine (version 16.1.0). Leading me to believe it's something specific to the agent machine you are running it on. Set system.debug = true in your release definition and please provide the full zip logs that you get. Also what agent are you using? private or hosted? Additionally please set up a public project with sample/dummy code as i have done above where you have the repro. This will make it easier for me to investigate |
@ShreyasRmsft , what you pointed to is a build pipeline. I explicitly underscored in the bug that the problem occurs inside a Release pipeline (please, pay attention). Build pipelines work fine. The build agent is the very default one provided by Azure DevOps, no changes. I just created an empty release pipeline and added a VsTest task to it, no any other specifics. Logs under system.debug=true are here: |
@scale-tone if you are running dotnet core tests you will need to make sure you run dotnet publish before running the tests in the releases pipeline (or a different machine from where the dlls were built basically. This is because additional dlls are copied to the output directory and these are required to run the tests. On the same machine they are picked up from the packages folder directly.) Sample release where I did not do dotnet publish. I got this error After doing the publish in the build definition here is the run in release There is no difference between the build pipeline and the release pipeline as far as the VsTest task is concerned! |
@scale-tone after examining the logs that you sent I see a different error than the one you reported
And here's a run with the same version of vstest.console.exe 16.1.1 where everything went smoothly |
@scale-tone I think the issue is specific to the test project that you have. Is it possible to provide a scaled down repro with a dummy test and dummy code and upload it somewhere on github? |
I think the issue is with the target framework of the test project. It would speed up the investigation if you can author a simple test project with a single dummy test (keeping all the target framework etc. similar to your actual test project) and see if it repros there and then provide that to me. I should be able to narrow down the cause. Also make sure you use the latest version 16.1.1 |
Indeed, occasionally it fails with a different error, without me doing or changing anything. Sources are here: https://github.com/scale-tone/WhatIfDemo/tree/master/WhatIfDemo-Functions.IntegrationTest. Have no idea what might be the "issue with the target framework of the test project". The release pipeline is this one: https://dev.azure.com/kolepes/WhatIfDemo/_release?definitionId=1 |
@scale-tone thanks. Let me take it from here. Will get to the RCA and update here. |
@scale-tone i am currently setting this up locally to get a repro i can debug through. Was a little busy the last few days. Will get back to you soon. Sorry for the delay. |
@scale-tone this has proved to be an interesting issue indeed! We had a small bug in our code where if the testhost process exited/crashed we were incorrectly showing this
I am currently in the process of fixing this logging issue. Further the root cause for this is that the testhost process is crashing and it is crashing because of this
On further digging the issue is in the dotnet sdk https://stackoverflow.com/questions/38085430/the-library-hostpolicy-dll-was-not-found I think publishing your test project using the dotnet publish command will probably solve the issue as a simple workaround instead of using msbuild to make the publish. |
dotnet publish over the test project during build time was not enough. |
[testProject].runtimeconfig.json gets generated in the publish folder itself right? Also I think you can remove the additional arguments from msbuid (/p:WebPublishMethod=FileSystem etc related to publishing your webapp) and use dotnet publish to publish your webapp also. You can find documentation for this on the dotnet cli page. Also many thanks for reporting this issue and patiently providing all the logs and samples needed for us to get to the bottom of this :) |
Description
"Visual Studio Test" task does not work in Azure DevOps Release Pipelines. This makes it impossible to run VsTest-based integration tests after deployments. The behavior differs from version to version. Latest VsTest fails immediately (and does not respect the VSTEST_CONNECTION_TIMEOUT environment variable). Previous versions hang forever.
Steps to reproduce
Expected behavior
The Release Pipeline succeeds, along with it's VsTest task.
Actual behavior
Latest VsTest (v.16.1.0) fails immediately with the following error:
Note the timing. Also note that VSTEST_CONNECTION_TIMEOUT environment variable was set to "600", and surprisingly enough the task prints the value of it, but does not respect it.
VsTest v.15.6.0 hangs:
Diagnostic logs
v.16.1.0:
v.15.6.0
Environment
The text was updated successfully, but these errors were encountered: