azure-pipelines-tasks: Test runs intermittently fail with "did not complete yet".

Required Information

Entering this information will route you directly to the right team and expedite traction.

Question, Bug, or Feature?
Bug

Enter Task Name:
VsTest

Environment

DevOps Server 2019.1 / Dev17.M153.3 Agent: Private, v2.153.1 on Windows 10 v1809

Issue Description

Test runs where vstest executes mstest unit tests intermittently fail with error message “Test run NNNN did not complete yet.”

(Edit: removed “on multiple agents” because this error reproduces for a run executing a single test)

Before this, the logs say IsValidServiceResponse: Received None command..Service Workflow is not active. Successful runs log “Received the command : Start”, while failing runs do not.

Error logs

Relevant section of a failing run

2020-01-15T14:44:12.8228735Z Test run with Id 32871 associated
2020-01-15T14:44:12.9581464Z ##[debug]TestHostStart.Run : Waiting to get a start command or stop/cancel command
2020-01-15T14:44:22.6980998Z IsValidServiceResponse: Received None command..Service Workflow is not active
2020-01-15T14:44:42.7125011Z IsValidServiceResponse: Received None command..Service Workflow is not active
2020-01-15T14:45:22.7503409Z IsValidServiceResponse: Received None command..Service Workflow is not active
2020-01-15T14:46:22.7426443Z IsValidServiceResponse: Received None command..Service Workflow is not active
2020-01-15T14:47:22.7365086Z IsValidServiceResponse: Received None command..Service Workflow is not active
2020-01-15T14:48:22.8552866Z IsValidServiceResponse: Received None command..Service Workflow is not active
2020-01-15T14:49:22.8468945Z IsValidServiceResponse: Received None command..Service Workflow is not active
2020-01-15T14:50:22.8552019Z IsValidServiceResponse: Received None command..Service Workflow is not active
2020-01-15T14:51:22.8904590Z IsValidServiceResponse: Received None command..Service Workflow is not active
2020-01-15T14:52:22.8791732Z IsValidServiceResponse: Received None command..Service Workflow is not active
2020-01-15T14:53:22.8891899Z IsValidServiceResponse: Received None command..Service Workflow is not active
2020-01-15T14:54:22.8998115Z IsValidServiceResponse: Received None command..Service Workflow is not active
2020-01-15T14:54:22.9050145Z TestExecutionHost.ProcessCommand. Stop Command handled
2020-01-15T14:54:22.9051666Z ##[debug]TestHostStart.Run : TestHost stop/cancel invoked
2020-01-15T14:54:22.9051985Z ##[debug]ExecutionStateResolver.SetNextPhase : Current Phase: TestHostStart
2020-01-15T14:54:22.9052242Z ##[debug]ExecutionStateResolver.SetNextPhase : Next Phase: TestHostEnd
2020-01-15T14:54:22.9052434Z ##[debug]TestExecutionHost.Execute: Current Phase TestHostEnd
2020-01-15T14:54:22.9053775Z ##[debug]VstestAdapter.ExecuteAsync : Starting Execution
2020-01-15T14:54:22.9910946Z ##[debug]ProceedAfterAbortedTestCase : False
2020-01-15T14:54:23.2377448Z ##[debug]SliceDetailsStore.NormalizeSettings : No Slice details or run information
2020-01-15T14:54:23.2377777Z ##[debug]VstestAdapter.ExecuteAsync : Returning
2020-01-15T14:54:23.2406652Z ##[debug]TestHostEnd.Run : CancellatationRequested: True : RunCreated : True : RunCompleted : False
2020-01-15T14:54:23.2505280Z ##[debug]TestHostEnd.Run: Run not completed. Waiting for the stop event
2020-01-15T14:54:23.2505582Z ##[debug]TestHostStop.Run : Logging the test run details
2020-01-15T14:54:23.2623773Z Test run '32871' is in 'InProgress' state.
2020-01-15T14:54:23.2705405Z ##[error]Test run 32871 did not complete yet.
2020-01-15T14:54:23.4977768Z ##[debug]Processed: ##vso[task.logissue type=error;]Test run 32871 did not complete yet.
2020-01-15T14:54:23.5004022Z ##[debug]Processed: ##vso[task.complete result=Failed;]Test run 32871 did not complete yet.
2020-01-15T14:54:23.5895491Z ##[debug]Deleted test settings with id : 9422

For comparison, a successful build has “Received the command : Start” and continues to execute tests.

2020-01-15T12:54:09.3060326Z Test run with Id 32829 associated
2020-01-15T12:54:09.4245735Z ##[debug]TestHostStart.Run : Waiting to get a start command or stop/cancel command
2020-01-15T12:54:20.2245116Z Received the command : Start
2020-01-15T12:54:20.2281652Z TestExecutionHost.ProcessCommand. Start Command handled
2020-01-15T12:54:20.2282673Z ##[debug]Notified the command 1 : {"Command":1}
2020-01-15T12:54:20.2283839Z ##[debug]TestHostStart.Run : TestHost start invoked
2020-01-15T12:54:20.2284475Z ##[debug]ExecutionStateResolver.SetNextPhase : Current Phase: TestHostStart

Task logs

Can provide privately if necessary, they are quite large

About this issue

  • Original URL
  • State: closed
  • Created 4 years ago
  • Comments: 15

Most upvoted comments

I’ve been experiencing the same issue since the start of this week. I updated the agent to 2.204.0 which appears to be when the issue began for me.

We had a similar issue a few months ago which we found was related to how the tests were batched across agents (based on running time of past tests), however in that case updating the agent version resolved the issue.

2022-07-08T04:12:01.3284945Z Test run with Id 1051814 associated 2022-07-08T04:12:01.4787032Z ##[debug]TestHostStart.Run : Waiting to get a start command or stop/cancel command 2022-07-08T04:12:11.2191812Z IsValidServiceResponse: Received None command…Service Workflow is not active 2022-07-08T04:12:31.2476066Z IsValidServiceResponse: Received None command…Service Workflow is not active 2022-07-08T04:13:11.2993824Z IsValidServiceResponse: Received None command…Service Workflow is not active 2022-07-08T04:14:11.3253814Z IsValidServiceResponse: Received None command…Service Workflow is not active 2022-07-08T04:15:11.3760336Z IsValidServiceResponse: Received None command…Service Workflow is not active 2022-07-08T04:16:11.4135820Z IsValidServiceResponse: Received None command…Service Workflow is not active 2022-07-08T04:17:11.4472260Z IsValidServiceResponse: Received None command…Service Workflow is not active 2022-07-08T04:18:11.4934706Z IsValidServiceResponse: Received None command…Service Workflow is not active 2022-07-08T04:19:11.5444266Z IsValidServiceResponse: Received None command…Service Workflow is not active 2022-07-08T04:20:11.5653588Z IsValidServiceResponse: Received None command…Service Workflow is not active 2022-07-08T04:21:11.5779821Z IsValidServiceResponse: Received None command…Service Workflow is not active 2022-07-08T04:22:11.5960419Z IsValidServiceResponse: Received None command…Service Workflow is not active 2022-07-08T04:22:11.5996397Z TestExecutionHost.ProcessCommand. Stop Command handled 2022-07-08T04:22:11.5998718Z ##[debug]TestHostStart.Run : TestHost stop/cancel invoked 2022-07-08T04:22:11.6000853Z ##[debug]ExecutionStateResolver.SetNextPhase : Current Phase: TestHostStart 2022-07-08T04:22:11.6003038Z ##[debug]ExecutionStateResolver.SetNextPhase : Next Phase: TestHostEnd 2022-07-08T04:22:11.6005146Z ##[debug]TestExecutionHost.Execute: Current Phase TestHostEnd 2022-07-08T04:22:11.6007155Z ##[debug]VstestAdapter.ExecuteAsync : Starting Execution 2022-07-08T04:22:11.6026170Z ##[debug]ProceedAfterAbortedTestCase : False 2022-07-08T04:22:11.6065764Z ##[debug]SliceDetailsStore.NormalizeSettings : No Slice details or run information 2022-07-08T04:22:11.6067833Z ##[debug]VstestAdapter.ExecuteAsync : Returning 2022-07-08T04:22:11.6086023Z ##[debug]TestHostEnd.Run : CancellatationRequested: True : RunCreated : True : RunCompleted : False 2022-07-08T04:22:11.6443304Z ##[debug]TestHostEnd.Run: Run not completed. Waiting for the stop event 2022-07-08T04:22:11.6445436Z ##[debug]TestHostStop.Run : Logging the test run details 2022-07-08T04:22:11.7252168Z Test run ‘1051814’ is in ‘InProgress’ state. 2022-07-08T04:22:11.7257845Z ##[error]Test run 1051814 did not complete yet.

@andersforsgren apologies, I meant to say the drift time only.

@andersforsgren @TimotyTimm I am using 2 types of pipelines 1. Scheduled Pipelines 2. On Demand Runners both of these pipelines uses Local Agents only

The Scheduled pipelines are working fine. There is no issue observed as of now.

However the On Demand Runners will be initiated from the Test Plan, these On Demand runner pipelines stopped working since 2nd/4th July 2022

For me it is not working for both - scheduled and on demand as well. Haven’t found any solutions for now.