summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorFadi Hanna <fadim@microsoft.com>2019-05-01 17:49:28 -0700
committerGitHub <noreply@github.com>2019-05-01 17:49:28 -0700
commit1144acad9bd92e0bd7485a0231ece95e016e5178 (patch)
tree54084dd81589ffeb5aae3ac600ab7749d3504e65 /tests
parent5a34da317e3f8cef7895d6d4ad6ed75f3a79d38e (diff)
downloadcoreclr-1144acad9bd92e0bd7485a0231ece95e016e5178.tar.gz
coreclr-1144acad9bd92e0bd7485a0231ece95e016e5178.tar.bz2
coreclr-1144acad9bd92e0bd7485a0231ece95e016e5178.zip
Update issues.targets and reduce test execution time. (#24345)
* Update issues.targets and reduce test execution time.
Diffstat (limited to 'tests')
-rw-r--r--tests/issues.targets9
-rw-r--r--tests/src/Interop/NativeLibraryResolveCallback/CallbackStressTest.cs28
2 files changed, 9 insertions, 28 deletions
diff --git a/tests/issues.targets b/tests/issues.targets
index 3518cce0e6..0f27a71ac3 100644
--- a/tests/issues.targets
+++ b/tests/issues.targets
@@ -74,12 +74,6 @@
<ExcludeList Include="$(XunitTestBinBase)/tracing/tracecontrol/tracecontrol/*">
<Issue>20299</Issue>
</ExcludeList>
- <ExcludeList Include="$(XunitTestBinBase)/Interop/NativeLibraryResolveEvent/ResolveEventTests/*">
- <Issue>23941</Issue>
- </ExcludeList>
- <ExcludeList Include="$(XunitTestBinBase)/Interop/NativeLibraryResolveCallback/CallbackTests/*">
- <Issue>23941</Issue>
- </ExcludeList>
<ExcludeList Include="$(XunitTestBinBase)/Interop/IJW/CopyConstructorMarshaler/CopyConstructorMarshaler/*">
<Issue>23358</Issue>
</ExcludeList>
@@ -95,9 +89,6 @@
<ExcludeList Include="$(XunitTestBinBase)/Interop/IJW/NativeCallingManaged/NativeCallingManaged/*">
<Issue>23358</Issue>
</ExcludeList>
- <ExcludeList Include="$(XunitTestBinBase)/Interop/NativeLibraryResolveCallback/CallbackStressTest/*">
- <Issue>24305</Issue>
- </ExcludeList>
</ItemGroup>
<!-- All Unix targets -->
diff --git a/tests/src/Interop/NativeLibraryResolveCallback/CallbackStressTest.cs b/tests/src/Interop/NativeLibraryResolveCallback/CallbackStressTest.cs
index bcbf9d7559..19f5310fa1 100644
--- a/tests/src/Interop/NativeLibraryResolveCallback/CallbackStressTest.cs
+++ b/tests/src/Interop/NativeLibraryResolveCallback/CallbackStressTest.cs
@@ -14,9 +14,7 @@ using Console = Internal.Console;
[assembly: DefaultDllImportSearchPaths(DllImportSearchPath.SafeDirectories)]
public class CallbackStressTest
{
- static volatile bool s_RunGC = true;
-
- static int s_LoopCounter = 25;
+ static int s_LoopCounter = 10;
static int s_FinallyCalled = 0;
static int s_CatchCalled = 0;
static int s_OtherExceptionCatchCalled = 0;
@@ -24,10 +22,6 @@ public class CallbackStressTest
static int s_WrongPInvokesExecuted = 0;
static int s_PInvokesExecuted = 0;
- public static void Collector()
- {
- while(s_RunGC) GC.Collect();
- }
[MethodImpl(MethodImplOptions.NoInlining)]
public static void SetResolve()
@@ -115,7 +109,7 @@ public class CallbackStressTest
{
RaiseException(5, 0, 0, IntPtr.Zero);
}
- catch(SEHException ex) { s_SEHExceptionCatchCalled++; }
+ catch(SEHException ex) { GC.Collect(); s_SEHExceptionCatchCalled++; }
#else
// TODO: test on Unix when implementing pinvoke inlining
s_SEHExceptionCatchCalled++;
@@ -124,8 +118,6 @@ public class CallbackStressTest
public static int Main()
{
- new Thread(Collector).Start();
-
for(int i = 0; i < s_LoopCounter; i++)
{
try
@@ -133,22 +125,22 @@ public class CallbackStressTest
NativeSum(10, 10);
s_WrongPInvokesExecuted++;
}
- catch (DllNotFoundException) { s_CatchCalled++; }
+ catch (DllNotFoundException) { GC.Collect(); s_CatchCalled++; }
try { DoCall(); }
- catch (DllNotFoundException) { s_CatchCalled++; }
+ catch (DllNotFoundException) { GC.Collect(); s_CatchCalled++; }
try { DoCallTryFinally(); }
- catch (DllNotFoundException) { s_CatchCalled++; }
+ catch (DllNotFoundException) { GC.Collect(); s_CatchCalled++; }
try { DoCallTryCatch(true); }
- catch (ArgumentException) { s_OtherExceptionCatchCalled++; }
+ catch (ArgumentException) { GC.Collect(); s_OtherExceptionCatchCalled++; }
try { DoCallTryRethrowInCatch(); }
- catch (DllNotFoundException) { s_CatchCalled++; }
+ catch (DllNotFoundException) { GC.Collect(); s_CatchCalled++; }
try { DoCallTryRethrowDifferentExceptionInCatch(); }
- catch (InvalidOperationException) { s_OtherExceptionCatchCalled++; }
+ catch (InvalidOperationException) { GC.Collect(); s_OtherExceptionCatchCalled++; }
ManualRaiseException();
}
@@ -162,13 +154,11 @@ public class CallbackStressTest
s_PInvokesExecuted += (a == b && a == 20)? 2 : 0;
try { DoCallTryCatch(false); }
- catch (ArgumentException) { s_OtherExceptionCatchCalled++; }
+ catch (ArgumentException) { GC.Collect(); s_OtherExceptionCatchCalled++; }
ManualRaiseException();
}
- s_RunGC = false;
-
if (s_FinallyCalled == s_LoopCounter &&
s_CatchCalled == (s_LoopCounter * 7) &&
s_OtherExceptionCatchCalled == (s_LoopCounter * 3) &&