Skip to content

Commit 537b99a

Browse files
committed
Fix flakiness in multi-threaded tests
1 parent 2b6aa24 commit 537b99a

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/ResourceManager/Profile/Commands.Profile.Test/LongRunningCmdletTests.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,7 @@ public void CanHandleShouldProcessExceptionForConfirm()
134134
mockRuntime.Setup((r) => r.ShouldProcess(It.IsAny<string>(), It.IsAny<string>())).Throws(new InvalidOperationException("Exception on ShouldProcess"));
135135
var job = cmdlet.ExecuteAsJob("Test Job") as AzureLongRunningJob<AzureStreamTestCmdlet>;
136136
int times = 0;
137-
while (times++ < 20 && job.StatusMessage != "Failed")
137+
while (times++ < 50 && job.StatusMessage != "Failed")
138138
{
139139
Thread.Sleep(TimeSpan.FromSeconds(1));
140140
if (job.StatusMessage == "Blocked")
@@ -179,7 +179,7 @@ public void CanHandleShouldContinueException()
179179
mockRuntime.Setup((r) => r.ShouldContinue(It.IsAny<string>(), It.IsAny<string>())).Throws(new InvalidOperationException("Exception on ShouldContinue"));
180180
var job = cmdlet.ExecuteAsJob("Test Job") as AzureLongRunningJob<AzureStreamTestCmdlet>;
181181
int times = 0;
182-
while (times++ < 20 && job.StatusMessage != "Failed")
182+
while (times++ < 50 && job.StatusMessage != "Failed")
183183
{
184184
Thread.Sleep(TimeSpan.FromSeconds(1));
185185
if (job.StatusMessage == "Blocked")

0 commit comments

Comments
 (0)