Skip to content
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
36 commits
Select commit Hold shift + click to select a range
2555cc5
wip
pavelsavara Feb 22, 2024
4627193
more
pavelsavara Feb 22, 2024
ea9021d
more
pavelsavara Feb 22, 2024
5b1e4bd
more
pavelsavara Feb 22, 2024
91fe85c
fix
pavelsavara Feb 22, 2024
2380cef
more
pavelsavara Feb 22, 2024
ba13f95
no MT wasi (yet)
pavelsavara Feb 22, 2024
9c89206
more
pavelsavara Feb 22, 2024
9240dbd
fix
pavelsavara Feb 22, 2024
abcf208
more
pavelsavara Feb 22, 2024
e38f38d
more
pavelsavara Feb 22, 2024
6ce0b1a
Merge branch 'main' into backgroud_exec_blocking_wait
pavelsavara Feb 22, 2024
2aa617f
fix
pavelsavara Feb 22, 2024
cf0e114
Merge branch 'main' into backgroud_exec_blocking_wait
pavelsavara Feb 22, 2024
1bc1d05
more
pavelsavara Feb 23, 2024
6dc7fce
more
pavelsavara Feb 23, 2024
56195f8
Merge branch 'main' into backgroud_exec_blocking_wait
maraf Feb 26, 2024
8963869
more
pavelsavara Mar 5, 2024
9d4d6f0
more
pavelsavara Mar 5, 2024
5bb627e
Merge branch 'main' into backgroud_exec_blocking_wait
jkotas Mar 5, 2024
302f708
more
pavelsavara Mar 6, 2024
b0da2a1
Merge branch 'main' into backgroud_exec_blocking_wait
pavelsavara Mar 6, 2024
629d6f4
enable System.Runtime.InteropServices.JavaScript.UnitTests
pavelsavara Mar 6, 2024
f6dffc8
more
pavelsavara Mar 6, 2024
68c43dc
bad merge
pavelsavara Mar 6, 2024
5b3149f
more
pavelsavara Mar 7, 2024
6b68573
Merge branch 'main' into backgroud_exec_blocking_wait
pavelsavara Mar 7, 2024
afea223
more
pavelsavara Mar 7, 2024
28b77df
more
pavelsavara Mar 7, 2024
1c6143e
more
pavelsavara Mar 7, 2024
e876247
more
pavelsavara Mar 8, 2024
0967c50
more
pavelsavara Mar 8, 2024
4b221de
Merge branch 'main' into backgroud_exec_blocking_wait
pavelsavara Mar 11, 2024
6e388e1
more
pavelsavara Mar 11, 2024
f5e6ed5
more
pavelsavara Mar 11, 2024
9448dfc
Merge branch 'main' into backgroud_exec_blocking_wait
pavelsavara Mar 12, 2024
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
Prev Previous commit
Next Next commit
more
  • Loading branch information
pavelsavara committed Feb 23, 2024
commit 1bc1d052f4ed8bc2a98209665d72bbfa78070eb2
Original file line number Diff line number Diff line change
Expand Up @@ -878,7 +878,7 @@ public void ManyConcurrentAddsTakesPeeks_ForceContentionWithOtherThreadsPeeking(
Assert.Equal(0, c.Count);
}

[ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))]
[ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedAndBlockingWait))]
[InlineData(ConcurrencyTestSeconds)]
public void ManyConcurrentAddsTakes_ForceContentionWithToArray(double seconds)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -384,7 +384,7 @@ public void IsStoppedTest()
/// <summary>
/// Tests Id generation
/// </summary>
[ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))]
[ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedAndBlockingWait))]
public void IdGenerationNoParent()
{
var orphan1 = new Activity("orphan1");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -223,7 +223,7 @@ public void BinderCacheFlushWhenTooBig()

}

[ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))]
[ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedAndBlockingWait))]
public void ConcurrentAdds()
{
for (int i = 0; i < 10; i++)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,7 @@ public static void GetEnumerator_MoveNextAfterEnd(Labeled<ParallelQuery<int>> la
Assert.False(enumerator.MoveNext());
}

[ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))]
[ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedAndBlockingWait))]
public static void GetEnumerator_LargeQuery_PauseAfterOpening()
{
using (IEnumerator<int> e = Enumerable.Range(0, 8192).AsParallel().SkipWhile(i => true).GetEnumerator())
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -503,7 +503,7 @@ public static void OrderByDescending_ArgumentNullException()
// On CTP-M1, this would deadlock for DOP=7,9,11,... on 4-core, but works for DOP=1..6 and 8,10,12, ...
//
// In this test, every call to the key-selector delegate throws.
[ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))]
[ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedAndBlockingWait))]
[MemberData(nameof(OrderByThreadedData), new[] { 1, 2, 16, 128, 1024 }, new[] { 1, 2, 4, 7, 8, 31, 32 })]
public static void OrderBy_ThreadedDeadlock(Labeled<ParallelQuery<int>> labeled, int count, int degree)
{
Expand All @@ -515,7 +515,7 @@ public static void OrderBy_ThreadedDeadlock(Labeled<ParallelQuery<int>> labeled,
}

// Heavily exercises OrderBy, but only throws one user delegate exception to simulate an occasional failure.
[ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))]
[ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedAndBlockingWait))]
[MemberData(nameof(OrderByThreadedData), new[] { 1, 2, 16, 128, 1024 }, new[] { 1, 2, 4, 7, 8, 31, 32 })]
public static void OrderBy_ThreadedDeadlock_SingleException(Labeled<ParallelQuery<int>> labeled, int count, int degree)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -194,7 +194,7 @@ public static async Task TestCanceledNullTextReaderAsync(TextReader input)
input.Dispose();
}

[Theory]
[ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedAndBlockingWait))]
[MemberData(nameof(NullWriters))]
public static void TextNullTextWriter(TextWriter output)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1148,7 +1148,7 @@ public static void RunLazyCancellationTests()
}
}

[ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))]
[ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedAndBlockingWait))]
public static void RunLazyCancellationTests_Negative()
{
for (int i = 0; i < 2; i++)
Expand Down Expand Up @@ -1238,7 +1238,7 @@ public static void LongContinuationChain_ContinueWith_DoesNotStackOverflow()
t.Wait();
}

[ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))]
[ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedAndBlockingWait))]
public static void LongContinuationChain_Unwrap_DoesNotStackOverflow()
{
const int DiveDepth = 12_000;
Expand All @@ -1254,7 +1254,7 @@ public static void LongContinuationChain_Unwrap_DoesNotStackOverflow()
func(DiveDepth).Wait();
}

[ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))]
[ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedAndBlockingWait))]
public static void LongContinuationChain_Await_DoesNotStackOverflow()
{
const int DiveDepth = 12_000;
Expand All @@ -1269,7 +1269,7 @@ await await Task.Factory.StartNew(() => func(count), CancellationToken.None, Tas
func(0).Wait();
}

[ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))]
[ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedAndBlockingWait))]
[InlineData(false)]
[InlineData(true)]
public static void TestNoDeadlockOnContinueWithExecuteSynchronously(bool useWaitAll)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ public async Task Create_BlockingWaitDoesNotBlockOtherPartitions()
}

// Uses Task.Wait in a Task.Run to purposefully test a blocking scenario, this doesn't work on WASM currently
[ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))]
[ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedAndBlockingWait))]
public async Task Create_BlockingFactoryDoesNotBlockOtherPartitions()
{
var limiterFactory = new TrackingRateLimiterFactory<int>();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,7 @@ public async Task TestSchedulerUsage()
}
}

[ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))]
[ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedAndBlockingWait))]
public async Task TestInputCount()
{
foreach (bool sync in DataflowTestHelpers.BooleanValues)
Expand Down Expand Up @@ -253,7 +253,7 @@ public async Task TestOrderMaintained()
}
}

[ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))]
[ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedAndBlockingWait))]
public async Task TestNonGreedy()
{
foreach (bool sync in DataflowTestHelpers.BooleanValues)
Expand Down Expand Up @@ -419,7 +419,7 @@ public async Task TestNullReturnedTasks()
actual: sumOfOdds);
}

[ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))]
[ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedAndBlockingWait))]
public async Task TestParallelExecution()
{
int dop = 2;
Expand All @@ -439,7 +439,7 @@ public async Task TestParallelExecution()
}
}

[ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))]
[ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedAndBlockingWait))]
public async Task TestReleasingOfPostponedMessages()
{
foreach (bool sync in DataflowTestHelpers.BooleanValues)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -570,7 +570,7 @@ public async Task TestReleasingFailsAtCompletion()
await Assert.ThrowsAsync<FormatException>(() => bb.Completion);
}

[ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))]
[ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedAndBlockingWait))]
public async Task TestSynchronousWaitForCompletionDoesNotDeadlock()
{
SynchronizationContext origContext = SynchronizationContext.Current;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ namespace System.Threading.Tasks.Dataflow.Tests
{
public class ConcurrentTests
{
[ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))]
[ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedAndBlockingWait))]
[OuterLoop]
public async Task StressTargetCorePostponement()
{
Expand Down Expand Up @@ -55,7 +55,7 @@ public async Task StressTargetCorePostponement()
static readonly int s_dop = Environment.ProcessorCount * 2;
const int IterationCount = 10000;

[ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))]
[ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedAndBlockingWait))]
[OuterLoop] // should be a stress test that runs for a while, but needs cleanup
public void RunConcurrentTests()
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -454,7 +454,7 @@ public void TestLinkTo_ArgumentValidation()
Assert.Throws<ArgumentNullException>(() => source.LinkTo(target, null, i => true));
}

[ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))]
[ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedAndBlockingWait))]
public void TestLinkTo_TwoPhaseCommit()
{
var source1 = new BufferBlock<int>();
Expand All @@ -478,7 +478,7 @@ public void TestLinkTo_TwoPhaseCommit()
Assert.Equal(expected: 43, actual: tuple.Item2);
}

[ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))]
[ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedAndBlockingWait))]
public async Task TestLinkTo_DoubleLinking()
{
foreach (bool greedy in DataflowTestHelpers.BooleanValues)
Expand Down Expand Up @@ -971,7 +971,7 @@ public async Task TestReceive_AlreadyAvailable()
Assert.Equal(expected: 0, actual: buffer.Count);
}

[ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))]
[ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedAndBlockingWait))]
public async Task TestReceive_NotYetAvailable()
{
var buffer = new BufferBlock<int>();
Expand Down Expand Up @@ -1005,7 +1005,7 @@ public async Task TestReceive_NotYetAvailable()
Assert.Equal(expected: 6, actual: await t4);
}

[ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))]
[ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedAndBlockingWait))]
[OuterLoop] // timeout involved
public async Task TestReceive_Timeout()
{
Expand All @@ -1028,7 +1028,7 @@ public async Task TestReceive_TimeoutZero()
}


[ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))]
[ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedAndBlockingWait))]
public async Task TestReceive_Cancellation()
{
var bb = new BufferBlock<int>();
Expand Down Expand Up @@ -1070,7 +1070,7 @@ public async Task TestReceive_Cancellation()
}
}

[ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))]
[ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedAndBlockingWait))]
public async Task TestReceive_CanceledSource()
{
foreach (bool beforeReceive in DataflowTestHelpers.BooleanValues)
Expand Down Expand Up @@ -1711,7 +1711,7 @@ public void TestEncapsulate_ArgumentValidation()
() => DataflowBlock.Encapsulate<int, int>(new BufferBlock<int>(), new BufferBlock<int>()).Fault(null));
}

[ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))]
[ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedAndBlockingWait))]
public void TestEncapsulate_LinkingAndUnlinking()
{
var buffer = new BufferBlock<int>();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -285,7 +285,7 @@ public async Task TestCountZeroAtCompletion()
Assert.Equal(expected: 0, actual: tb.OutputCount);
}

[ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))]
[ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedAndBlockingWait))]
public void TestInputCount()
{
foreach (bool sync in DataflowTestHelpers.BooleanValues)
Expand Down Expand Up @@ -315,7 +315,7 @@ public void TestInputCount()
}
}

[ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))]
[ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedAndBlockingWait))]
[OuterLoop] // spins waiting for a condition to be true, though it should happen very quickly
public async Task TestCount()
{
Expand Down Expand Up @@ -640,7 +640,7 @@ public async Task TestOrdering_Async_OrderedDisabled()
await tb.Completion;
}

[ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))]
[ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedAndBlockingWait))]
public async Task TestOrdering_Sync_OrderedDisabled()
{
// If ordering were enabled, this test would hang.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -304,7 +304,7 @@ public async Task TestCountZeroAtCompletionAsyncEnumerable()
Assert.Equal(expected: 0, actual: tb.OutputCount);
}

[ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))]
[ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedAndBlockingWait))]
public void TestInputCountAsyncEnumerable()
{
using Barrier barrier1 = new Barrier(2), barrier2 = new Barrier(2);
Expand All @@ -330,7 +330,7 @@ IAsyncEnumerable<int> body(int item)
}
}

[ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))]
[ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedAndBlockingWait))]
[OuterLoop] // spins waiting for a condition to be true, though it should happen very quickly
public async Task TestCountAsyncEnumerable()
{
Expand Down Expand Up @@ -630,7 +630,7 @@ public async Task TestOrdering_Sync_OrderedEnabledAsyncEnumerable(int mmpt, int
await tb.Completion;
}

[ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))]
[ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedAndBlockingWait))]
[InlineData(true)]
[InlineData(false)]
public async Task TestOrdering_Sync_OrderedDisabledAsyncEnumerable(bool trustedEnumeration)
Expand Down Expand Up @@ -658,7 +658,7 @@ public async Task TestOrdering_Sync_OrderedDisabledAsyncEnumerable(bool trustedE
await tb.Completion;
}

[ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))]
[ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedAndBlockingWait))]
[InlineData(false)]
[InlineData(true)]
public async Task TestOrdering_Sync_BlockingEnumeration_NoDeadlockAsyncEnumerable(bool ensureOrdered)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -313,7 +313,7 @@ public async Task TestCountZeroAtCompletion()
Assert.Equal(expected: 0, actual: tb.OutputCount);
}

[ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))]
[ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedAndBlockingWait))]
public void TestInputCount()
{
foreach (bool sync in DataflowTestHelpers.BooleanValues)
Expand Down Expand Up @@ -343,7 +343,7 @@ public void TestInputCount()
}
}

[ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))]
[ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedAndBlockingWait))]
[OuterLoop] // spins waiting for a condition to be true, though it should happen very quickly
public async Task TestCount()
{
Expand Down Expand Up @@ -753,7 +753,7 @@ public async Task TestOrdering_Async_OrderedDisabled(bool trustedEnumeration)
await tb.Completion;
}

[ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))]
[ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedAndBlockingWait))]
[InlineData(true)]
[InlineData(false)]
public async Task TestOrdering_Sync_OrderedDisabled(bool trustedEnumeration)
Expand Down Expand Up @@ -781,7 +781,7 @@ public async Task TestOrdering_Sync_OrderedDisabled(bool trustedEnumeration)
await tb.Completion;
}

[ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))]
[ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedAndBlockingWait))]
[InlineData(false)]
[InlineData(true)]
public async Task TestOrdering_Sync_BlockingEnumeration_NoDeadlock(bool ensureOrdered)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,7 @@ public async Task TestPostThenReceive()
await wob.Completion;
}

[ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))]
[ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedAndBlockingWait))]
public async Task TestReceiveThenPost()
{
var wob = new WriteOnceBlock<int>(null);
Expand Down
Loading