Skip to content

Commit c5e7fac

Browse files
authored
Disable async test assert with race condition (#118735)
1 parent edb570c commit c5e7fac

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

src/tests/async/synchronization-context/synchronization-context.cs

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,8 +40,11 @@ private static async Task TestSyncContextContinueAsync()
4040
await WrappedYieldToThreadPool(suspend: false).ConfigureAwait(false);
4141
Assert.Same(context, SynchronizationContext.Current);
4242

43-
await WrappedYieldToThreadPool(suspend: true).ConfigureAwait(false);
44-
Assert.Null(SynchronizationContext.Current);
43+
// Currently disabled since ConfigureAwait does not become a runtime async call,
44+
// and this has a race condition until it does (where the callee finishes before
45+
// we check IsCompleted on the awaiter).
46+
//await WrappedYieldToThreadPool(suspend: true).ConfigureAwait(false);
47+
//Assert.Null(SynchronizationContext.Current);
4548

4649
await WrappedYieldToThreadWithCustomSyncContext();
4750
Assert.Null(SynchronizationContext.Current);

0 commit comments

Comments
 (0)