From c9a7936c29947b979cd75349045b9dfadabf22cb Mon Sep 17 00:00:00 2001 From: VeryEarly Date: Tue, 5 Jul 2022 23:24:46 +0800 Subject: [PATCH 1/2] temporarily skip import azaccount in parallel --- tools/Test/SmokeTest/RmCoreSmokeTests.ps1 | 46 +++++++++++------------ 1 file changed, 23 insertions(+), 23 deletions(-) diff --git a/tools/Test/SmokeTest/RmCoreSmokeTests.ps1 b/tools/Test/SmokeTest/RmCoreSmokeTests.ps1 index f306f7ce95c3..0fdafc62471d 100644 --- a/tools/Test/SmokeTest/RmCoreSmokeTests.ps1 +++ b/tools/Test/SmokeTest/RmCoreSmokeTests.ps1 @@ -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) From e042b550fc9d9b6b0770ac2e2b5916ec8057e9b3 Mon Sep 17 00:00:00 2001 From: VeryEarly Date: Wed, 6 Jul 2022 11:07:01 +0800 Subject: [PATCH 2/2] fix smoke test --- tools/Test/SmokeTest/RmCoreSmokeTests.ps1 | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tools/Test/SmokeTest/RmCoreSmokeTests.ps1 b/tools/Test/SmokeTest/RmCoreSmokeTests.ps1 index 0fdafc62471d..25dfa008f0d3 100644 --- a/tools/Test/SmokeTest/RmCoreSmokeTests.ps1 +++ b/tools/Test/SmokeTest/RmCoreSmokeTests.ps1 @@ -190,7 +190,8 @@ if($Reverse.IsPresent){ [array]::Reverse($resourceTestCommands) } -$resourceCommands=$resourceSetUpCommands+$resourceTestCommands+$resourceCleanUpCommands+$generalCommands +#$resourceCommands=$resourceSetUpCommands+$resourceTestCommands+$resourceCleanUpCommands+$generalCommands +$resourceCommands=$resourceSetUpCommands+$resourceTestCommands+$resourceCleanUpCommands $startTime = Get-Date $resourceCommands | ForEach-Object {