AzureDevOpsExtension
AzureDevOpsExtension copied to clipboard
Pester script is hanging after the recent Pull Requests
There is a Pester script processed with Azure Devops task "Pester Test Runner" and It has been detected as broken within version 9.4.0 and it worked for 9.3.0. It is not related to the agent because it is hanging within Azure Pipelines agents too and there were no changes in the custom pool. The current behavior: the task is going to be started for minutes. Expected (previous) behavior: the task executes simple pester scripts for <2 minutes.
Hi
Can you try running the pipeline with diagnostics enabled and sharing the logs? You can enable diagnostics by setting the system.debug variable to true at queue time.
Thanks.
Hi, please see below: `[section]****************************************************************************** [section]Starting: TASK NAME [section]******************************************************************************
Task : Pester Test Runner Description : Run Pester tests by either installing the latest version of Pester at run time (if possible) or using the version shipped with the task (4.10.1) Version : 9.4.0 Author : Pester Help : Version: #{Build.BuildNumber}#. More Information
[debug]agent.TempDirectory=PATH_temp
[debug]loading inputs and endpoints
[debug]loading ENDPOINT_AUTH_PARAMETER_SYSTEMVSSCONNECTION_ACCESSTOKEN
[debug]loading ENDPOINT_AUTH_SCHEME_SYSTEMVSSCONNECTION
[debug]loading ENDPOINT_AUTH_SYSTEMVSSCONNECTION
[debug]loading INPUT_PESTERVERSION
[debug]loading INPUT_RESULTSFILE
[debug]loading INPUT_RUN32BIT
[debug]loading INPUT_SCRIPTFOLDER
[debug]loading INPUT_USEPSCORE
[debug]loading SECRET_
And it is not able to continue, it is possible to cancel only. PS version = 5.1
We are also seeing this behavior for v10. For us we were able to debug that it hangs because it is trying to install nuget
package provider and waiting for user input.
The provider 'nuget v2.8.5.208' is not installed.
nuget may be manually downloaded from https://onegetcdn.azureedge.net/providers/Microsoft.PackageManagement.NuGetProvider-2.8.5.208.dll and installed.
Would you like PackageManagement to automatically download and install 'nuget' now?
[Y] Yes [N] No [S] Suspend [?] Help (default is "Y"):
Based on this it shouldn't happen. https://github.com/pester/AzureDevOpsExtension/blob/d60600507af9c4ddba2a4316a2b3c955eb1330b6/Extension/PesterTask/PesterV10/HelperModule.psm1#L45
@ChrisLGardner Any help on this is helpful.
Can confirm. Pester runner is unable to install a package non-interactively.
C:\a_work\1\s>powershell.exe C:\a_work\_tasks\Pester_cca5462b-887d-4617-bf3f-dcf0d3c622e9\10.3.10\Pester.ps1 -TestFolder C:\a_work\1\s\PesterTestsV5\* -resultsFile C:\a_work\1\s\Test-Pester.XML -run32Bit False -FailOnStdErr true -TargetPesterVersion 5.0.0
TestFolder C:\a_work\1\s\PesterTestsV5\*
resultsFile C:\a_work\1\s\Test-Pester.XML
run32Bit False
additionalModulePath
tag
ExcludeTag
CodeCoverageOutputFile
CodeCoverageFolder
ScriptBlock
FailOnStdErr trueThe provider 'nuget v2.8.5.208' is not installed.
nuget may be manually downloaded from https://onegetcdn.azureedge.net/providers/Microsoft.PackageManagement.NuGetProvider-2.8.5.208.dll and installed.
Would you like PackageManagement to automatically download and install 'nuget' now?
[Y] Yes [N] No [S] Suspend [?] Help (default is "Y"):
Also, I assume the installation is triggered somewhere from here:
https://github.com/pester/AzureDevOpsExtension/blob/master/Extension/PesterTask/PesterV10/HelperModule.psm1#L45
That Install-PackageProvider cmdlet finishes successfully and installs package non-interactively
I too am seeing his issue. I've tried explicitly installing nuget in a Powershell ADO task immeditelay prior to the Pester test Runner task. Using:- Install-PackageProvider NuGet -Force
But the problem persists on the execution of the Pester Test Runner task. Curious as to how this is not affecting everyone? Any workarounds suggested? Or fixes coming?