Skip to content

Commit 58310db

Browse files
author
Nitin Gurram
committed
Restart the service instead of start to handle one corner scenario
1 parent 6defac1 commit 58310db

File tree

3 files changed

+6
-6
lines changed

3 files changed

+6
-6
lines changed

Tasks/DeployVisualStudioTestAgent/TestAgentConfiguration.ps1

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -773,7 +773,7 @@ function InvokeDTAExecHostExe([string] $Version, [System.Management.Automation.P
773773
{
774774
$session = CreateNewSession -MachineCredential $MachineCredential
775775
# Make sure DTA Agent Execution Service starts first before invoking DTA Execution Host
776-
Invoke-Command -Session $session -ErrorAction SilentlyContinue -ErrorVariable err -OutVariable out { Start-Service -Name "DTAAgentExecutionService" }
776+
Invoke-Command -Session $session -ErrorAction SilentlyContinue -ErrorVariable err -OutVariable out { Restart-Service -Name "DTAAgentExecutionService" }
777777
Write-Verbose -Message ("Error : {0} " -f ($err | out-string)) -Verbose
778778
Write-Verbose -Message ("Output : {0} " -f ($out | out-string)) -Verbose
779779

@@ -955,4 +955,4 @@ if ($ret -eq $false)
955955
{
956956
$returnCode = ConfigureTestAgent -TfsCollection $tfsCollectionUrl -AsServiceOrProcess $asServiceOrProcess -EnvironmentUrl $environmentUrl -MachineName $machineName -MachineUserCredential $machineCredential -DisableScreenSaver $disableScreenSaver -EnableAutoLogon $enableAutoLogon -PersonalAccessToken $PersonalAccessToken -Capabilities $capabilities -AgentUserCredential $agentCredential
957957
return $returnCode;
958-
}
958+
}

Tasks/DeployVisualStudioTestAgent/task.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
"version": {
1414
"Major": 1,
1515
"Minor": 0,
16-
"Patch": 33
16+
"Patch": 34
1717
},
1818
"demands": [
1919

@@ -171,4 +171,4 @@
171171
"workingDirectory": "$(currentDirectory)"
172172
}
173173
}
174-
}
174+
}

Tasks/DeployVisualStudioTestAgent/task.loc.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
"version": {
1414
"Major": 1,
1515
"Minor": 0,
16-
"Patch": 33
16+
"Patch": 34
1717
},
1818
"demands": [],
1919
"minimumAgentVersion": "1.101.0",
@@ -169,4 +169,4 @@
169169
"workingDirectory": "$(currentDirectory)"
170170
}
171171
}
172-
}
172+
}

0 commit comments

Comments
 (0)