Skip to content

Commit

Permalink
temporarily skip import azaccount in parallel (Azure#18870)
Browse files Browse the repository at this point in the history
  • Loading branch information
VeryEarly authored Jul 6, 2022
1 parent deab1d1 commit 69c883a
Showing 1 changed file with 23 additions and 23 deletions.
46 changes: 23 additions & 23 deletions tools/Test/SmokeTest/RmCoreSmokeTests.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -162,29 +162,29 @@ $resourceTestCommands = @(
@{Name = "Az.Websites"; Command = {Get-AzWebApp -ResourceGroupName $resourceGroupName}}
)

$generalCommands = @(
@{
Name = "Import Az.Accounts in Parallel";
Command = {
if ($null -ne $env:SYSTEM_DEFINITIONID) {
Write-Host "Skipping because 'Start-Job' is not supported by design in scenarios where PowerShell is being hosted in other applications."
return
}
$importJobs = @()
1..10 | ForEach-Object {
$importJobs += Start-Job -name "import-no.$_" -ScriptBlock { Import-Module Az.Accounts; Get-AzConfig; }
}
$importJobs | Wait-Job
$importJobs | Receive-Job
$importJobs | ForEach-Object {
if ("Completed" -ne $_.State) {
throw "Some jobs have failed."
}
}
};
Retry = 0; # no need to retry
}
)
# $generalCommands = @(
# @{
# Name = "Import Az.Accounts in Parallel";
# Command = {
# if ($null -ne $env:SYSTEM_DEFINITIONID) {
# Write-Host "Skipping because 'Start-Job' is not supported by design in scenarios where PowerShell is being hosted in other applications."
# return
# }
# $importJobs = @()
# 1..10 | ForEach-Object {
# $importJobs += Start-Job -name "import-no.$_" -ScriptBlock { Import-Module Az.Accounts; Get-AzConfig; }
# }
# $importJobs | Wait-Job
# $importJobs | Receive-Job
# $importJobs | ForEach-Object {
# if ("Completed" -ne $_.State) {
# throw "Some jobs have failed."
# }
# }
# };
# Retry = 0; # no need to retry
# }
# )

if($Reverse.IsPresent){
[array]::Reverse($resourceTestCommands)
Expand Down

0 comments on commit 69c883a

Please sign in to comment.