Skip to content
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

If you can’t beat ’em, join ’em #3225

Merged
merged 1 commit into from
May 1, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
10 changes: 7 additions & 3 deletions src/NUnitFramework/tests/Attributes/TimeoutTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,9 @@ public void TestWithTimeoutCurrentContextIsNotAnAdhocContext()
}

#if PLATFORM_DETECTION && THREAD_ABORT
// Most recent version of Mono tested: 5.20.1
private const string MonoFailsToAbortThreadReason = "ThreadAbortException is never thrown on Mono";

[Test, Timeout(500)]
public void TestWithTimeoutRunsOnSameThread()
{
Expand All @@ -63,7 +66,7 @@ public void TestWithTimeoutRunsSetUpAndTestOnSameThread()
}

[Test]
[Platform(Exclude = "Mono", Reason = "Runner hangs at end when this is run")]
[Platform(Exclude = "Mono", Reason = MonoFailsToAbortThreadReason)]
public void TestTimesOutAndTearDownIsRun()
{
TimeoutFixture fixture = new TimeoutFixture();
Expand All @@ -88,7 +91,7 @@ public void SetUpTimesOutAndTearDownIsRun()
}

[Test]
[Platform(Exclude = "Mono", Reason = "Test never aborts on Mono (tested 5.4–5.12)")]
[Platform(Exclude = "Mono", Reason = MonoFailsToAbortThreadReason)]
public void TearDownTimesOutAndNoFurtherTearDownIsRun()
{
TimeoutFixture fixture = new TimeoutFixtureWithTimeoutInTearDown();
Expand All @@ -101,7 +104,7 @@ public void TearDownTimesOutAndNoFurtherTearDownIsRun()
}

[Test]
[Platform(Exclude = "Mono", Reason = "Runner hangs at end when this is run")]
[Platform(Exclude = "Mono", Reason = MonoFailsToAbortThreadReason)]
public void TimeoutCanBeSetOnTestFixture()
{
ITestResult suiteResult = TestBuilder.RunTestFixture(typeof(TimeoutFixtureWithTimeoutOnFixture));
Expand Down Expand Up @@ -172,6 +175,7 @@ public void TestTimeOutTestCaseWithOutElapsed()
}

[Test, Platform("Win")]
[Platform(Exclude = "Mono", Reason = MonoFailsToAbortThreadReason)]
public void TimeoutWithMessagePumpShouldAbort()
{
ITestResult result = TestBuilder.RunTest(
Expand Down