Browse Source

Threading UnitTests: force 15s timeout on all tests

la-knuth
Christoph Ruegg 17 years ago
parent
commit
b52cb7b3be
  1. 38
      src/UnitTests/ThreadingTests/ParallelForEachTests.cs
  2. 22
      src/UnitTests/ThreadingTests/ParallelForTests.cs

38
src/UnitTests/ThreadingTests/ParallelForEachTests.cs

@ -37,7 +37,7 @@ namespace MathNet.Numerics.UnitTests.ThreadingTests
[TestFixture]
public class ParallelForEachTests
{
[Test, ApartmentState(ApartmentState.MTA)]
[Test, ApartmentState(ApartmentState.MTA), Timeout(15)]
[Column(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 100, 1001)]
public void ParallelForEachInvokesEveryItemInListOnceMTAOnePerCore(int count)
{
@ -65,7 +65,7 @@ namespace MathNet.Numerics.UnitTests.ThreadingTests
}
}
[Test, ApartmentState(ApartmentState.STA)]
[Test, ApartmentState(ApartmentState.STA), Timeout(15)]
[Column(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 100, 1001)]
public void ParallelForEachInvokesEveryItemInListOnceSTAOnePerCore(int count)
{
@ -93,7 +93,7 @@ namespace MathNet.Numerics.UnitTests.ThreadingTests
}
}
[Test, ApartmentState(ApartmentState.MTA)]
[Test, ApartmentState(ApartmentState.MTA), Timeout(15)]
[Column(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 100, 1001)]
public void ParallelForEachInvokesEveryItemInListOnceMTATwoPerCore(int count)
{
@ -121,7 +121,7 @@ namespace MathNet.Numerics.UnitTests.ThreadingTests
}
}
[Test, ApartmentState(ApartmentState.STA)]
[Test, ApartmentState(ApartmentState.STA), Timeout(15)]
[Column(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 100, 1001)]
public void ParallelForEachInvokesEveryItemInListOnceSTATwoPerCore(int count)
{
@ -149,7 +149,7 @@ namespace MathNet.Numerics.UnitTests.ThreadingTests
}
}
[Test, ApartmentState(ApartmentState.MTA)]
[Test, ApartmentState(ApartmentState.MTA), Timeout(15)]
[Column(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 100, 1001)]
public void ParallelForEachInvokesEveryItemInSetOnceMTAOnePerCore(int count)
{
@ -177,7 +177,7 @@ namespace MathNet.Numerics.UnitTests.ThreadingTests
}
}
[Test, ApartmentState(ApartmentState.STA)]
[Test, ApartmentState(ApartmentState.STA), Timeout(15)]
[Column(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 100, 1001)]
public void ParallelForEachInvokesEveryItemInSetOnceSTAOnePerCore(int count)
{
@ -205,7 +205,7 @@ namespace MathNet.Numerics.UnitTests.ThreadingTests
}
}
[Test, ApartmentState(ApartmentState.MTA)]
[Test, ApartmentState(ApartmentState.MTA), Timeout(15)]
[Column(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 100, 1001)]
public void ParallelForEachInvokesEveryItemInSetOnceMTATwoPerCore(int count)
{
@ -233,7 +233,7 @@ namespace MathNet.Numerics.UnitTests.ThreadingTests
}
}
[Test, ApartmentState(ApartmentState.STA)]
[Test, ApartmentState(ApartmentState.STA), Timeout(15)]
[Column(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 100, 1001)]
public void ParallelForEachInvokesEveryItemInSetOnceSTATwoPerCore(int count)
{
@ -261,7 +261,7 @@ namespace MathNet.Numerics.UnitTests.ThreadingTests
}
}
[Test, ApartmentState(ApartmentState.MTA)]
[Test, ApartmentState(ApartmentState.MTA), Timeout(15)]
public void DoesNotGetConfusedByMultipleStartShutdown()
{
ThreadQueue.Shutdown();
@ -305,7 +305,7 @@ namespace MathNet.Numerics.UnitTests.ThreadingTests
}
}
[Test, ApartmentState(ApartmentState.MTA)]
[Test, ApartmentState(ApartmentState.MTA), Timeout(15)]
public void DoesDetectAndResolveRecursiveParallelization()
{
var countSharedBetweenClosures = 0;
@ -337,7 +337,7 @@ namespace MathNet.Numerics.UnitTests.ThreadingTests
Assert.AreEqual(1000, countSharedBetweenClosures);
}
[Test, ApartmentState(ApartmentState.MTA)]
[Test, ApartmentState(ApartmentState.MTA), Timeout(15)]
[Column(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 100, 1001)]
public void ParallelForEachInvokesEveryItemInListOnceMTAOnePerCoreWithIntialAndFinally(int count)
{
@ -366,7 +366,7 @@ namespace MathNet.Numerics.UnitTests.ThreadingTests
Assert.AreEqual(count * 2, sum);
}
[Test, ApartmentState(ApartmentState.STA)]
[Test, ApartmentState(ApartmentState.STA), Timeout(15)]
[Column(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 100, 1001)]
public void ParallelForEachInvokesEveryItemInListOnceSTAOnePerCoreWithIntialAndFinally(int count)
{
@ -395,7 +395,7 @@ namespace MathNet.Numerics.UnitTests.ThreadingTests
Assert.AreEqual(count * 2, sum);
}
[Test, ApartmentState(ApartmentState.MTA)]
[Test, ApartmentState(ApartmentState.MTA), Timeout(15)]
[Column(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 100, 1001)]
public void ParallelForEachInvokesEveryItemInListOnceMTATwoPerCoreWithIntialAndFinally(int count)
{
@ -423,7 +423,7 @@ namespace MathNet.Numerics.UnitTests.ThreadingTests
Assert.AreEqual(count * 2, sum);
}
[Test, ApartmentState(ApartmentState.STA)]
[Test, ApartmentState(ApartmentState.STA), Timeout(15)]
[Column(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 100, 1001)]
public void ParallelForEachInvokesEveryItemInListOnceSTATwoPerCoreWithIntialAndFinally(int count)
{
@ -451,7 +451,7 @@ namespace MathNet.Numerics.UnitTests.ThreadingTests
Assert.AreEqual(count * 2, sum);
}
[Test, ApartmentState(ApartmentState.MTA)]
[Test, ApartmentState(ApartmentState.MTA), Timeout(15)]
[Column(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 100, 1001)]
public void ParallelForEachInvokesEveryItemInSetOnceMTAOnePerCoreWithIntialAndFinally(int count)
{
@ -480,7 +480,7 @@ namespace MathNet.Numerics.UnitTests.ThreadingTests
Assert.AreEqual(count * 2, sum);
}
[Test, ApartmentState(ApartmentState.STA)]
[Test, ApartmentState(ApartmentState.STA), Timeout(15)]
[Column(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 100, 1001)]
public void ParallelForEachInvokesEveryItemInSetOnceSTAOnePerCoreWithIntialAndFinally(int count)
{
@ -509,7 +509,7 @@ namespace MathNet.Numerics.UnitTests.ThreadingTests
Assert.AreEqual(count * 2, sum);
}
[Test, ApartmentState(ApartmentState.MTA)]
[Test, ApartmentState(ApartmentState.MTA), Timeout(15)]
[Column(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 100, 1001)]
public void ParallelForEachInvokesEveryItemInSetOnceMTATwoPerCoreWithIntialAndFinally(int count)
{
@ -537,7 +537,7 @@ namespace MathNet.Numerics.UnitTests.ThreadingTests
Assert.AreEqual(count * 2, sum);
}
[Test, ApartmentState(ApartmentState.STA)]
[Test, ApartmentState(ApartmentState.STA), Timeout(15)]
[Column(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 100, 1001)]
public void ParallelForEachInvokesEveryItemInSetOnceSTATwoPerCoreWithIntialAndFinally(int count)
{
@ -565,7 +565,7 @@ namespace MathNet.Numerics.UnitTests.ThreadingTests
Assert.AreEqual(count * 2, sum);
}
[Test]
[Test, Timeout(15)]
public void DoesDetectAndResolveRecursiveParallelizationWithIntialAndFinally()
{
var countSharedBetweenClosures = 0;

22
src/UnitTests/ThreadingTests/ParallelForTests.cs

@ -36,7 +36,7 @@ namespace MathNet.Numerics.UnitTests.ThreadingTests
[TestFixture]
public class ParallelForTests
{
[Test, ApartmentState(ApartmentState.MTA)]
[Test, ApartmentState(ApartmentState.MTA), Timeout(15)]
[Column(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 100, 101)]
public void ParallelForInvokesEveryItemOnceMTAOnePerCore(int count)
{
@ -54,7 +54,7 @@ namespace MathNet.Numerics.UnitTests.ThreadingTests
}
}
[Test, ApartmentState(ApartmentState.STA)]
[Test, ApartmentState(ApartmentState.STA), Timeout(15)]
[Column(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 100, 101)]
public void ParallelForInvokesEveryItemOnceSTAOnePerCore(int count)
{
@ -72,7 +72,7 @@ namespace MathNet.Numerics.UnitTests.ThreadingTests
}
}
[Test, ApartmentState(ApartmentState.MTA)]
[Test, ApartmentState(ApartmentState.MTA), Timeout(15)]
[Column(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 100, 101)]
public void ParallelForInvokesEveryItemOnceMTATwoPerCore(int count)
{
@ -90,7 +90,7 @@ namespace MathNet.Numerics.UnitTests.ThreadingTests
}
}
[Test, ApartmentState(ApartmentState.STA)]
[Test, ApartmentState(ApartmentState.STA), Timeout(15)]
[Column(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 100, 101)]
public void ParallelForInvokesEveryItemOnceSTATwoPerCore(int count)
{
@ -108,7 +108,7 @@ namespace MathNet.Numerics.UnitTests.ThreadingTests
}
}
[Test, ApartmentState(ApartmentState.MTA)]
[Test, ApartmentState(ApartmentState.MTA), Timeout(15)]
public void DoesNotGetConfusedByMultipleStartShutdown()
{
ThreadQueue.Shutdown();
@ -144,7 +144,7 @@ namespace MathNet.Numerics.UnitTests.ThreadingTests
}
}
[Test, ApartmentState(ApartmentState.MTA), Timeout(30)]
[Test, ApartmentState(ApartmentState.MTA), Timeout(15)]
public void DoesDetectAndResolveRecursiveParallelization()
{
int countSharedBetweenClosures = 0;
@ -187,7 +187,7 @@ namespace MathNet.Numerics.UnitTests.ThreadingTests
Assert.AreEqual(1000, countSharedBetweenClosures);
}
[Test, ApartmentState(ApartmentState.MTA)]
[Test, ApartmentState(ApartmentState.MTA), Timeout(15)]
[Column(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 100, 101)]
public void ParallelForInvokesEveryItemOnceMTAOnePerCoreWithIntialAndFinally(int count)
{
@ -218,7 +218,7 @@ namespace MathNet.Numerics.UnitTests.ThreadingTests
Assert.AreEqual(count * 2, sum);
}
[Test, ApartmentState(ApartmentState.STA)]
[Test, ApartmentState(ApartmentState.STA), Timeout(15)]
[Column(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 100, 101)]
public void ParallelForInvokesEveryItemOnceSTAOnePerCoreWithIntialAndFinally(int count)
{
@ -249,7 +249,7 @@ namespace MathNet.Numerics.UnitTests.ThreadingTests
Assert.AreEqual(count * 2, sum);
}
[Test, ApartmentState(ApartmentState.MTA)]
[Test, ApartmentState(ApartmentState.MTA), Timeout(15)]
[Column(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 100, 101)]
public void ParallelForInvokesEveryItemOnceMTATwoPerCoreWithIntialAndFinally(int count)
{
@ -279,7 +279,7 @@ namespace MathNet.Numerics.UnitTests.ThreadingTests
Assert.AreEqual(count * 2, sum);
}
[Test, ApartmentState(ApartmentState.STA)]
[Test, ApartmentState(ApartmentState.STA), Timeout(15)]
[Column(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 100, 101)]
public void ParallelForInvokesEveryItemOnceSTATwoPerCoreWithIntialAndFinally(int count)
{
@ -309,7 +309,7 @@ namespace MathNet.Numerics.UnitTests.ThreadingTests
Assert.AreEqual(count * 2, sum);
}
[Test, ApartmentState(ApartmentState.MTA), Timeout(30)]
[Test, ApartmentState(ApartmentState.MTA), Timeout(15)]
public void DoesDetectAndResolveRecursiveParallelizationWithIntialAndFinally()
{
int countSharedBetweenClosures = 0;

Loading…
Cancel
Save