Skip to content

Thread pool scheduling event listener behave differently when it is run on xunit app #2202

Answered by bradwilson
NazmiAltun asked this question in Question
Discussion options

You must be logged in to vote

I honestly don't know the answer to this question, but here is some information about the way xUnit.net works that might contribute to you finding an answer.

We have two synchronization contexts (that is, classes which derive from SynchronizationContext): AsyncTestSyncContext and MaxConcurrencySyncContext.

  • AsyncTestSyncContext allows us to support tests that are written as async void and still track the proper lifetime of the test method.
  • MaxConcurrencySyncContext allows us to create a limited set of worker threads to be used for scheduling Tasks that we have created, so as to limit the number of threads that are allowed to run in parallel at any given time.

In normal operation we use t…

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@bradwilson
Comment options

Answer selected by bradwilson
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
2 participants