Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Include owning test name in exception when zombied SyncContext is used #56

Merged
merged 1 commit into from
Jan 21, 2022

Conversation

lg2de
Copy link
Contributor

@lg2de lg2de commented Jan 21, 2022

report the name of the thread if UISynchronizationContext is invoked and pump already ended

@lg2de
Copy link
Contributor Author

lg2de commented Jan 21, 2022

I was not able to run the tests locally.
The CI build seems not to work for PRs :(

We are facing issues with tests failed with

### error output ###
The active test run was aborted. Reason: Test host process crashed : Unhandled exception. System.InvalidOperationException: The message pump isn't running any more.
   at Xunit.Sdk.UISynchronizationContext.Post(SendOrPostCallback d, Object state)
   at System.Threading.Tasks.Sources.ManualResetValueTaskSourceCore`1.InvokeContinuation()
   at System.Threading.Tasks.Sources.ManualResetValueTaskSourceCore`1.SignalCompletion()
   at System.Threading.Tasks.Sources.ManualResetValueTaskSourceCore`1.SetResult(TResult result)
   at System.Threading.Channels.ChannelReader`1.ReadAllAsync(CancellationToken cancellationToken)+MoveNext()
   at System.Runtime.CompilerServices.AsyncTaskMethodBuilder`1.AsyncStateMachineBox`1.ExecutionContextCallback(Object s)
   at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state)
--- End of stack trace from previous location where exception was thrown ---
   at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state)
   at System.Runtime.CompilerServices.AsyncTaskMethodBuilder`1.AsyncStateMachineBox`1.MoveNext(Thread threadPoolThread)
   at System.Runtime.CompilerServices.AsyncTaskMethodBuilder`1.AsyncStateMachineBox`1.MoveNext()
   at System.Threading.ThreadPoolGlobals.<>c.<.cctor>b__5_0(Object state)
   at System.Threading.Channels.AsyncOperation`1.SetCompletionAndInvokeContinuation()
   at System.Threading.Channels.AsyncOperation`1.System.Threading.IThreadPoolWorkItem.Execute()
   at System.Threading.ThreadPoolWorkQueue.Dispatch()
   at System.Threading._ThreadPoolWaitCallback.PerformWaitCallback()

We would like to know which test causes the problem.
What do you think @AArnott ?

@AArnott
Copy link
Owner

AArnott commented Jan 21, 2022

/azp run

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

Copy link
Owner

@AArnott AArnott left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Change looks good to me.

@AArnott AArnott changed the title report the name of the thread if UISynchronizationContext is invoked … Include owning test name in exception when zombied SyncContext is used Jan 21, 2022
@AArnott AArnott added this to the v1.1 milestone Jan 21, 2022
@AArnott AArnott merged commit 918fda0 into AArnott:main Jan 21, 2022
@lg2de lg2de deleted the named-context branch January 22, 2022 16:06
@lg2de
Copy link
Contributor Author

lg2de commented Jan 24, 2022

Thanks for your fast response.
We have identified the failing tests with this extension. :)

Could you please create a public (non-alpha) release?

@AArnott
Copy link
Owner

AArnott commented Jan 24, 2022

Watch for 1.1.10 to push to nuget.org in the next hour.

@AArnott
Copy link
Owner

AArnott commented Jan 24, 2022

Make that 1.1.11.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants