Skip to content

Commit 24836b9

Browse files
committed
Test case optimized to reduce execution time.
1 parent a37b4e9 commit 24836b9

File tree

3 files changed

+183
-868
lines changed

3 files changed

+183
-868
lines changed

src/ResourceManager/LogicApp/Commands.LogicApp.Test/ScenarioTests/WorkflowTriggerTests.ps1

Lines changed: 8 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -53,9 +53,9 @@ function Test-GetAzureLogicAppTriggerHistory
5353

5454
[int]$counter = 0
5555
do {
56-
Sleep -seconds 2
56+
Sleep -Milliseconds 2000
5757
$workflow = Get-AzureRmLogicApp -ResourceGroupName $resourceGroupName -Name $workflowName
58-
} while ($workflow.State -ne "Enabled" -or $counter++ -lt 5)
58+
} while ($workflow.State -ne "Enabled" -and $counter++ -lt 5)
5959

6060
Start-AzureRmLogicApp -ResourceGroupName $resourceGroupName -Name $workflowName -TriggerName "httpTrigger"
6161

@@ -85,20 +85,13 @@ function Test-StartAzureLogicAppTrigger
8585

8686
[int]$counter = 0
8787
do {
88-
Sleep -seconds 2
88+
Sleep -Milliseconds 2000
8989
$workflow = Get-AzureRmLogicApp -ResourceGroupName $resourceGroupName -Name $workflowName
90-
} while ($workflow.State -ne "Enabled" -or $counter++ -lt 5)
90+
} while ($workflow.State -ne "Enabled" -and $counter++ -lt 5)
9191

92-
$workflowTriggerHistories1 = Get-AzureRmLogicAppTriggerHistory -ResourceGroupName $resourceGroupName -Name $workflowName -TriggerName "httpTrigger"
93-
$counter = 2
94-
while($val -lt $counter)
95-
{
96-
Start-AzureRmLogicApp -ResourceGroupName $resourceGroupName -Name $workflowName -TriggerName "httpTrigger"
97-
Sleep -seconds 1
98-
$val++
99-
}
92+
Start-AzureRmLogicApp -ResourceGroupName $resourceGroupName -Name $workflowName -TriggerName "httpTrigger"
10093

101-
$workflowTriggerHistories2 = Get-AzureRmLogicAppTriggerHistory -ResourceGroupName $resourceGroupName -Name $workflowName -TriggerName "httpTrigger"
102-
$count = $workflowTriggerHistories2.Count - $workflowTriggerHistories1.Count
103-
Assert-AreEqual $counter $count
94+
$workflowTriggerHistories = Get-AzureRmLogicAppTriggerHistory -ResourceGroupName $resourceGroupName -Name $workflowName -TriggerName "httpTrigger"
95+
96+
Assert-AreEqual 1 $workflowTriggerHistories.Count
10497
}

0 commit comments

Comments
 (0)