Skip to content

Fix flaky long running operation test #6204

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
May 23, 2018
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ public LongRunningCmdletTests(ITestOutputHelper output)
}

[Fact]
[Trait(Category.AcceptanceType, Category.Flaky)]
[Trait(Category.AcceptanceType, Category.CheckIn)]
public void CanReceiveAllStreams()
{
Mock<ICommandRuntime> mockRuntime;
Expand All @@ -61,7 +61,7 @@ public void CanReceiveAllStreams()
}

[Fact]
[Trait(Category.AcceptanceType, Category.Flaky)]
[Trait(Category.AcceptanceType, Category.CheckIn)]
public void CanSupportShouldProcess()
{
Mock<ICommandRuntime> mockRuntime;
Expand All @@ -74,7 +74,7 @@ public void CanSupportShouldProcess()
}

[Fact]
[Trait(Category.AcceptanceType, Category.Flaky)]
[Trait(Category.AcceptanceType, Category.CheckIn)]
public void CanSupportShouldContinue()
{
Mock<ICommandRuntime> mockRuntime;
Expand All @@ -88,7 +88,7 @@ public void CanSupportShouldContinue()
}

[Fact]
[Trait(Category.AcceptanceType, Category.Flaky)]
[Trait(Category.AcceptanceType, Category.CheckIn)]
public void CanHandleCmdletException()
{
Mock<ICommandRuntime> mockRuntime;
Expand All @@ -103,7 +103,7 @@ public void CanHandleCmdletException()
}

[Fact]
[Trait(Category.AcceptanceType, Category.Flaky)]
[Trait(Category.AcceptanceType, Category.CheckIn)]
public void CanHandleCmdletStop()
{
Mock<ICommandRuntime> mockRuntime;
Expand All @@ -116,7 +116,7 @@ public void CanHandleCmdletStop()
if (job.JobStateInfo.State != JobState.Completed)
{
job.StopJob();
this.jobCompleted.WaitOne(TimeSpan.FromSeconds(10));
this.jobCompleted.WaitOne(TimeSpan.FromHours(4));
Assert.Equal("Stopped", job.StatusMessage);
}

Expand All @@ -129,7 +129,7 @@ public void CanHandleCmdletStop()


[Fact]
[Trait(Category.AcceptanceType, Category.Flaky)]
[Trait(Category.AcceptanceType, Category.CheckIn)]
public void CanHandleShouldProcessExceptionForConfirm()
{
Mock<ICommandRuntime> mockRuntime;
Expand All @@ -145,7 +145,7 @@ public void CanHandleShouldProcessExceptionForConfirm()
}

[Fact]
[Trait(Category.AcceptanceType, Category.Flaky)]
[Trait(Category.AcceptanceType, Category.CheckIn)]
public void CanHandleShouldProcessExceptionForWhatIf()
{
Mock<ICommandRuntime> mockRuntime;
Expand All @@ -162,7 +162,7 @@ public void CanHandleShouldProcessExceptionForWhatIf()
}

[Fact]
[Trait(Category.AcceptanceType, Category.Flaky)]
[Trait(Category.AcceptanceType, Category.CheckIn)]
public void CanHandleShouldContinueException()
{
Mock<ICommandRuntime> mockRuntime;
Expand All @@ -177,7 +177,7 @@ public void CanHandleShouldContinueException()
}

[Fact]
[Trait(Category.AcceptanceType, Category.Flaky)]
[Trait(Category.AcceptanceType, Category.CheckIn)]
public void JobCopiesCmdletParameterSet()
{
Mock<ICommandRuntime> mock = new Mock<ICommandRuntime>();
Expand Down Expand Up @@ -265,7 +265,7 @@ void WaitForCompletion(AzureLongRunningJob job, Action<AzureLongRunningJob> vali
try
{
HandleStateChange(job, new JobStateEventArgs(job.JobStateInfo, new JobStateInfo(JobState.NotStarted)));
this.jobCompleted.WaitOne(TimeSpan.FromSeconds(30));
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we just make this arbitrarily large (like FromHours(4)?

jobCompleted.WaitOne(TimeSpan.FromHours(4));
validate(job);
}
finally
Expand Down