Skip to content

Commit 9e188fc

Browse files
authored
Update test cases and skip sleep (#12568)
1 parent e84a545 commit 9e188fc

File tree

3 files changed

+12
-6
lines changed

3 files changed

+12
-6
lines changed

src/Network/Network.Test/ScenarioTests/ApplicationGatewayTests.ps1

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3089,17 +3089,17 @@ function Test-ApplicationGatewayPrivateEndpointWorkFlows
30893089
$approve = Approve-AzPrivateEndpointConnection -ResourceId $connection.Id
30903090
Assert-NotNull $approve;
30913091
Assert-AreEqual "Approved" $approve.PrivateLinkServiceConnectionState.Status
3092-
Start-Sleep -s 30
3092+
Start-TestSleep -s 30
30933093

30943094
# Deny Connection
30953095
$deny = Deny-AzPrivateEndpointConnection -ResourceId $connection.Id
30963096
Assert-NotNull $deny;
30973097
Assert-AreEqual "Rejected" $deny.PrivateLinkServiceConnectionState.Status
3098-
Start-Sleep -s 30
3098+
Start-TestSleep -s 30
30993099

31003100
# Remove Connection
31013101
$remove = Remove-AzPrivateEndpointConnection -ResourceId $connection.Id -Force
3102-
Start-Sleep -s 30
3102+
Start-TestSleep -s 30
31033103

31043104
# Verify PrivateEndpointConnections on Application Gateway
31053105
$getgw = Get-AzApplicationGateway -Name $appgwName -ResourceGroupName $rgname

src/Resources/Resources.Test/ScenarioTests/InvokeResourceActionTests.ps1

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,9 @@ function Test-InvokeResourceActionsWithResouceId
4646
$statusChanged = $true
4747
break
4848
}
49-
start-sleep -seconds 20
49+
if ([Microsoft.Azure.Test.HttpRecorder.HttpMockServer]::Mode -ne [Microsoft.Azure.Test.HttpRecorder.HttpRecorderMode]::Playback) {
50+
start-sleep -seconds 20
51+
}
5052
}
5153

5254
Assert-True { $statusChanged }

src/Resources/Resources.Test/ScenarioTests/ResourceTests.ps1

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -889,7 +889,9 @@ function Test-SetAResourceTagCase
889889

890890
# Set resource (add a new tag with key testTag2 = "TestVal2")
891891
Set-AzResource -Tags @{testtag = "testval"; testTag2 = "TestVal2"} -ResourceGroupName $rgname -ResourceName $rname -ResourceType $resourceType -Properties @{"key2" = "value2"} -Force
892-
Start-Sleep -s 30
892+
if ([Microsoft.Azure.Test.HttpRecorder.HttpMockServer]::Mode -ne [Microsoft.Azure.Test.HttpRecorder.HttpRecorderMode]::Playback) {
893+
Start-Sleep -s 30
894+
}
893895
$resource = Get-AzResource -ResourceGroupName $rgname -ResourceName $rname -ResourceType $resourceType
894896

895897
# Verify tag keys
@@ -908,7 +910,9 @@ function Test-SetAResourceTagCase
908910

909911
# Set resource (replace tags with keys of different cases)
910912
Set-AzResource -Tags @{testTag = "testVAL"; testtag2 = "Testval2"} -ResourceGroupName $rgname -ResourceName $rname -ResourceType $resourceType -Properties @{"key2" = "value2"} -Force
911-
Start-Sleep -s 30
913+
if ([Microsoft.Azure.Test.HttpRecorder.HttpMockServer]::Mode -ne [Microsoft.Azure.Test.HttpRecorder.HttpRecorderMode]::Playback) {
914+
Start-Sleep -s 30
915+
}
912916
$resource = Get-AzResource -ResourceGroupName $rgname -ResourceName $rname -ResourceType $resourceType
913917

914918
# Verify tag keys

0 commit comments

Comments
 (0)