Skip to content

Commit

Permalink
increase wait
Browse files Browse the repository at this point in the history
  • Loading branch information
sebassem committed Oct 12, 2023
1 parent aea473b commit 2092848
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions tests/pester/full.tests.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -65,10 +65,10 @@ Describe "Bicep Landing Zone (Sub) Vending Tests" {
It "Should Have a Role Assignment for an known AAD Group with the Reader role directly upon the Subscription" {
$iterationCount = 0
do {
$roleAssignment = Get-AzRoleAssignment -Scope "/subscriptions/$subId" -RoleDefinitionName "Reader" -ErrorAction SilentlyContinue | Where-Object {$_.ObjectId -eq "7eca0dca-6701-46f1-b7b6-8b424dab50b3"}
$roleAssignment = Get-AzRoleAssignment -Scope "/subscriptions/$subId" -RoleDefinitionName "Reader" -ObjectId "7eca0dca-6701-46f1-b7b6-8b424dab50b3" -ErrorAction SilentlyContinue
if ($null -eq $roleAssignment) {
Write-Host "Waiting for Subscription Role Assignments to be eventually consistent... Iteration: $($iterationCount)" -ForegroundColor Yellow
Start-Sleep -Seconds 15
Start-Sleep -Seconds 30
$iterationCount++
}
} until (
Expand All @@ -83,10 +83,10 @@ Describe "Bicep Landing Zone (Sub) Vending Tests" {
It "Should Have a Role Assignment for an known AAD Group with the Network Contributor role directly upon the Resource Group" {
$iterationCount = 0
do {
$roleAssignment = Get-AzRoleAssignment -Scope "/subscriptions/$subId/resourceGroups/rsg-$location-net-hs-pr-$prNumber" -RoleDefinitionName "Network Contributor" -ErrorAction SilentlyContinue | Where-Object {$_.ObjectId -eq "7eca0dca-6701-46f1-b7b6-8b424dab50b3"}
$roleAssignment = Get-AzRoleAssignment -Scope "/subscriptions/$subId/resourceGroups/rsg-$location-net-hs-pr-$prNumber" -RoleDefinitionName "Network Contributor" -ObjectId "7eca0dca-6701-46f1-b7b6-8b424dab50b3" -ErrorAction SilentlyContinue
if ($null -eq $roleAssignment) {
Write-Host "Waiting for Resource Group Role Assignments to be eventually consistent... Iteration: $($iterationCount)" -ForegroundColor Yellow
Start-Sleep -Seconds 15
Start-Sleep -Seconds 30
$iterationCount++
}
} until (
Expand Down

0 comments on commit 2092848

Please sign in to comment.