question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Visual Studio Test task fails with System.IO.FileNotFoundException on temp file when run Impacted tests is enabled.

See original GitHub issue

Type: Bug

Task Name: Visual Studio Test

Environment

  • Server - Azure Pipelines

  • Agent - Hosted:

    • OS: Windows Server 2016 Standard

    • Visual Studio Version: 2019

    • Agent Version: 2.155.1

Issue Description

The task has started failing every time it runs. It started failing when the pipeline auto-updated the task from version 2.159.1 to version 2.160.2.

The log for this task shows it failing with a System.IO.FileNotFoundException:

Task logs

logs_15713.zip

Error logs

##[error]Error occured while executing System.IO.FileNotFoundException: Could not find file 'E:\agentG2\_work\_temp\m0umztbldww.tmp'. File name: 'E:\agentG2\_work\_temp\m0umztbldww.tmp' at System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath) at System.IO.FileStream.Init(String path, FileMode mode, FileAccess access, Int32 rights, Boolean useRights, FileShare share, Int32 bufferSize, FileOptions options, SECURITY_ATTRIBUTES secAttrs, String msgPath, Boolean bFromProxy, Boolean useLongPath, Boolean checkHost) at System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access, FileShare share, Int32 bufferSize, FileOptions options, String msgPath, Boolean bFromProxy, Boolean useLongPath, Boolean checkHost) at System.IO.StreamReader..ctor(String path, Encoding encoding, Boolean detectEncodingFromByteOrderMarks, Int32 bufferSize, Boolean checkHost) at System.IO.StreamReader..ctor(String path, Encoding encoding) at System.IO.File.InternalReadAllLines(String path, Encoding encoding) at MS.VS.TestService.VstestConsoleAdapter.TestSelectorCommandInputs.GetTestsList(String listTestsFile) at MS.VS.TestService.VstestConsoleAdapter.TestSelectorCommandInputs.GetImpactedTestsCommandInput(VstestConsoleRunContext testRunContext) at MS.VS.TestService.VstestConsoleAdapter.ExecutionStateResolver.GetNextPhase(VstestConsoleRunContext consoleRunContext, ITestRunPhase currentPhase, ITestRunPhaseResults phaseResult) Completed TestExecution Model... ##[warning]Vstest failed with error. Check logs for failures. There might be failed tests. ##[error]Error: The process 'E:\agentG2\_work\_tasks\VSTest_ef087383-ee5e-42c7-9a53-ab56c98420f9\2.160.2\Modules\DTAExecutionHost.exe' failed with exit code 1 ##[error]Vstest failed with error. Check logs for failures. There might be failed tests. ##[section]Finishing: VsTest - testAssemblies x86

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Reactions:1
  • Comments:16 (6 by maintainers)

github_iconTop GitHub Comments

5reactions
garrettloycommented, Nov 13, 2019

Running into the same error. I have 6 test tasks in a pipeline and this was happening to two of them - the ones that had “Run only impacted tests” checked. Unchecked that and now the test tasks don’t error out.

2reactions
Spikritcommented, Nov 20, 2019

I gave it a go and can confirm v2.160.4 works as expected while looking for impacted tests again :

***************************** Section 'Get Impacted Tests' Starting *****************************
V, 2019/11/20, 15:06:05.737, PERF: CreateTestRun: took 153.1381 ms
V, 2019/11/20, 15:06:05.737, PERF WARNING: CreateTestRun: took 153.1381 ms
V, 2019/11/20, 15:06:05.737, Tests that are discovered.

...

V, 2019/11/20, 15:06:07.018, Published Test Run : 1013592
***************************** Section 'Update test results' Ended ********************************
Read more comments on GitHub >

github_iconTop Results From Across the Web

VsTest task now fails due to options code coverage and ...
Below is an example of the error we received for our failed builds. ##[error]Error occured while executing System.IO.FileNotFoundException: Could not find file ......
Read more >
vstest.console throws System.IO.FileNotFoundException
The solution is using a .runsettings file. In the runsettings file it is possible to specify "DeploymentEnabled". By default this is true.
Read more >
Debugging System.IO.FileNotFoundException - Cause and fix
IO.FileNotFoundException. Admitted! In all instances this error is caused by trying to access a file that isn't there.
Read more >
Gradle 7.0 Release Notes
If a task is failing input/output validation, Gradle will now execute it without the benefit of parallel execution, up-to-date checks and the build...
Read more >
Microsoft/msbuild - Gitter
Severity Code Description Project File Line Suppression State Error MSB4018 The "TestTask" task failed unexpectedly. System.IO.FileNotFoundException: Could ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found