Skip to content

Commit

Permalink
[mono] Review [SkipOnTargetFramework(TargetFrameworkMonikers.Mono...]…
Browse files Browse the repository at this point in the history
… occurrences (dotnet#31920)

* Review test attributes

* Disable System.Threading.Tests.SynchronizationContextTests.WaitNotificationTest with an active issue
  • Loading branch information
MaximLipnin authored Feb 8, 2020
1 parent 98d47d5 commit 76f525d
Show file tree
Hide file tree
Showing 13 changed files with 6 additions and 29 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -153,8 +153,7 @@ protected override DbDataReader ExecuteDbDataReader(CommandBehavior behavior)
}
}

[Fact]
[SkipOnTargetFramework(TargetFrameworkMonikers.Mono, "GC has different behavior on Mono")]
[ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsPreciseGcSupported))]
public void CanBeFinalized()
{
FinalizingCommand.CreateAndRelease();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -136,8 +136,7 @@ private class TestDbProviderFactory : DbProviderFactory
public static DbProviderFactory Instance = new TestDbProviderFactory();
}

[Fact]
[SkipOnTargetFramework(TargetFrameworkMonikers.Mono, "GC has different behavior on Mono")]
[ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsPreciseGcSupported))]
public void CanBeFinalized()
{
FinalizingConnection.CreateAndRelease();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1316,8 +1316,7 @@ public void StandardInput_GetNotRedirected_ThrowsInvalidOperationException()
Assert.Throws<InvalidOperationException>(() => process.StandardInput);
}

[Fact]
[SkipOnTargetFramework(TargetFrameworkMonikers.Mono, "GC has different behavior on Mono")]
[ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsPreciseGcSupported))]
public void CanBeFinalized()
{
FinalizingProcess.CreateAndRelease();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -773,8 +773,7 @@ private static async Task SendPingAsync(Func<Ping, Task<PingReply>> sendPing, Ac
pingResultValidator(pingResult);
}

[Fact]
[SkipOnTargetFramework(TargetFrameworkMonikers.Mono, "GC has different behavior on Mono")]
[ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsPreciseGcSupported))]
public void CanBeFinalized()
{
FinalizingPing.CreateAndRelease();
Expand Down
3 changes: 0 additions & 3 deletions src/libraries/System.Net.Requests/tests/HttpWebRequestTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1148,7 +1148,6 @@ public void BeginGetRequestStream_CreatePostRequestThenAbort_ThrowsWebException(
}

[Theory, MemberData(nameof(EchoServers))]
[SkipOnTargetFramework(TargetFrameworkMonikers.Mono, "no exception thrown on mono")]
public void BeginGetRequestStream_CreatePostRequestThenCallTwice_ThrowsInvalidOperationException(Uri remoteServer)
{
HttpWebRequest request = HttpWebRequest.CreateHttp(remoteServer);
Expand Down Expand Up @@ -1715,7 +1714,6 @@ await LoopbackServer.CreateServerAsync((server, url) =>
}

[ActiveIssue("https://github.com/dotnet/corefx/issues/19083")]
[SkipOnTargetFramework(TargetFrameworkMonikers.Mono, "https://github.com/dotnet/corefx/issues/19083")]
[Fact]
public async Task Abort_BeginGetRequestStreamThenAbort_EndGetRequestStreamThrowsWebException()
{
Expand All @@ -1737,7 +1735,6 @@ await LoopbackServer.CreateServerAsync((server, url) =>
});
}

[SkipOnTargetFramework(TargetFrameworkMonikers.Mono, "ResponseCallback not called after Abort on mono")]
[Fact]
public async Task Abort_BeginGetResponseThenAbort_ResponseCallbackCalledBeforeAbortReturns()
{
Expand Down
1 change: 0 additions & 1 deletion src/libraries/System.Net.Requests/tests/LoggingTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ namespace System.Net.Tests
public class LoggingTest
{
[Fact]
[SkipOnTargetFramework(TargetFrameworkMonikers.Mono, "NetEventSource is only part of .NET Core.")]
[SkipOnCoreClr("System.Net.Tests are flaky", RuntimeConfiguration.Checked)]
public void EventSource_ExistsWithCorrectId()
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ namespace System.Net.Tests
public class WebHeaderCollectionLoggingTest
{
[Fact]
[SkipOnTargetFramework(TargetFrameworkMonikers.Mono, "NetEventSource is only part of .NET Core")]
public void EventSource_ExistsWithCorrectId()
{
Type esType = typeof(WebHeaderCollection).Assembly.GetType("System.Net.NetEventSource", throwOnError: true, ignoreCase: false);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -541,7 +541,6 @@ public void Add_InvalidHeader_ThrowsArgumentException(string header, string para
private const string CookieInvalid = "helloWorld";

[Fact]
[SkipOnTargetFramework(TargetFrameworkMonikers.Mono, "Does not work in Mono")]
public void GetValues_MultipleSetCookieHeadersWithExpiresAttribute_Success()
{
WebHeaderCollection w = new WebHeaderCollection();
Expand All @@ -559,7 +558,6 @@ public void GetValues_MultipleSetCookieHeadersWithExpiresAttribute_Success()
}

[Fact]
[SkipOnTargetFramework(TargetFrameworkMonikers.Mono, "Does not work in Mono")]
public void GetValues_SingleSetCookieHeaderWithMultipleCookiesWithExpiresAttribute_Success()
{
WebHeaderCollection w = new WebHeaderCollection();
Expand Down Expand Up @@ -605,7 +603,6 @@ public void GetValues_SingleSetCookieHeaderWithMultipleCookiesWithNoAttribute_Su
}

[Fact]
[SkipOnTargetFramework(TargetFrameworkMonikers.Mono, "Does not work in Mono")]
public void GetValues_InvalidSetCookieHeader_Success()
{
WebHeaderCollection w = new WebHeaderCollection();
Expand Down
6 changes: 0 additions & 6 deletions src/libraries/System.Threading.Thread/tests/ThreadTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -321,7 +321,6 @@ public static void ApartmentStateTest_Unix(
}

[Fact]
[SkipOnTargetFramework(TargetFrameworkMonikers.Mono)]
public static void CurrentCultureTest_DifferentThread()
{
CultureInfo culture = (CultureInfo)CultureInfo.CurrentCulture.Clone();
Expand Down Expand Up @@ -404,7 +403,6 @@ public static void CurrentCultureTest()
}

[Fact]
[SkipOnTargetFramework(TargetFrameworkMonikers.Mono)]
public static void CurrentPrincipalTest_SkipOnDesktopFramework()
{
ThreadTestHelpers.RunTestInBackgroundThread(() => Assert.Null(Thread.CurrentPrincipal));
Expand Down Expand Up @@ -460,7 +458,6 @@ await Task.Run(() =>
}

[Fact]
[SkipOnTargetFramework(TargetFrameworkMonikers.Mono)]
public static void CurrentPrincipalContextFlowTest_NotFlow()
{
ThreadTestHelpers.RunTestInBackgroundThread(async () =>
Expand Down Expand Up @@ -527,7 +524,6 @@ public static void CurrentThreadTest()
}

[Fact]
[SkipOnTargetFramework(TargetFrameworkMonikers.Mono)]
public static void ExecutionContextTest()
{
ThreadTestHelpers.RunTestInBackgroundThread(
Expand Down Expand Up @@ -705,7 +701,6 @@ public static void ThreadStateTest()
}

[Fact]
[SkipOnTargetFramework(TargetFrameworkMonikers.Mono)]
public static void AbortSuspendTest()
{
var e = new ManualResetEvent(false);
Expand Down Expand Up @@ -1079,7 +1074,6 @@ public static void StartTest()
}

[Fact]
[SkipOnTargetFramework(TargetFrameworkMonikers.Mono)]
public static void MiscellaneousTest()
{
Thread.BeginCriticalRegion();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,6 @@ public static void SetMinMaxThreadsTest()
}

[Fact]
[SkipOnTargetFramework(TargetFrameworkMonikers.Mono)]
public static void SetMinMaxThreadsTest_ChangedInDotNetCore()
{
int minw, minc, maxw, maxc;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,6 @@ public static void FlowTest()
}

[Fact]
[SkipOnTargetFramework(TargetFrameworkMonikers.Mono)]
public static void CaptureThenSuppressThenRunFlowTest()
{
ThreadTestHelpers.RunTestInBackgroundThread(() =>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ namespace System.Threading.Tests
public static class SynchronizationContextTests
{
[Fact]
[SkipOnTargetFramework(TargetFrameworkMonikers.Mono, "SynchronizationContext.Wait(IntPtr[], bool, int) is not implemented on Mono")]
public static void WaitTest()
{
var tsc = new TestSynchronizationContext();
Expand All @@ -37,14 +36,13 @@ public static void WaitTest()
}

[Fact]
[SkipOnTargetFramework(TargetFrameworkMonikers.Mono)]
public static void WaitTest_ChangedInDotNetCore()
{
Assert.Throws<ArgumentNullException>(() => TestSynchronizationContext.WaitHelper(null, false, 0));
}

[Fact]
[SkipOnTargetFramework(TargetFrameworkMonikers.Mono, "https://bugzilla.xamarin.com/show_bug.cgi?id=60568")]
[ActiveIssue("https://github.com/dotnet/runtime/issues/31977", TargetFrameworkMonikers.Mono)]
public static void WaitNotificationTest()
{
ThreadTestHelpers.RunTestInBackgroundThread(() =>
Expand Down
3 changes: 1 addition & 2 deletions src/libraries/System.Threading/tests/ThreadLocalTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -315,8 +315,7 @@ private static void RunThreadLocalTest8Helper(ManualResetEventSlim mres)
Assert.Throws<ObjectDisposedException>(() => values = tl.Values);
}

[Fact]
[SkipOnTargetFramework(TargetFrameworkMonikers.Mono, "This test requires precise stack scanning")]
[ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsPreciseGcSupported))]
public static void RunThreadLocalTest8_Values_NegativeCases()
{
// Test that Dispose works and that objects are released on dispose
Expand Down

0 comments on commit 76f525d

Please sign in to comment.