-
Notifications
You must be signed in to change notification settings - Fork 48
HostedTaskService.StopAsync throws LockRecursionException when using WebApplicationFactory #304
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
Comments
Thanks for your report @MarcelMichau , can you update to the latest nightly and retest? You can do that by updating your nuget refs to use 1.*-* |
Thank you @MattB-msft for reverting back. I've created a minimal repro repo here for reference: https://github.com/MarcelMichau/AgentWebApplicationFactory. This is using the latest nightly build as suggested. I could not, however, get the same exception thrown in the minimal repro, though I did observe test hangs around 120s during certain test executions. Here is an example run where the test ran quick:
Here is an example of the test hanging for ~120s:
Note that the hang does not occur on every run, only on certain runs, which makes it tricky to reproduce reliably. |
@MarcelMichau One thought is that we override the Hosted Service shutdown. But... the default timeout is 60s and that doesn't quite match up. |
Thanks @tracyboehrer - I believe the 120s number is due to the two registered hosted services ( Doing some digging, I'm wondering if the exception is thrown as a result of this issue where the |
Version
What package version of the SDK are you using.
Describe the bug
When running integration tests using
WebApplicationFactory
for a project which includes an agent added viabuilder.AddAgent<T>()
, during test cleanup/disposal of theWebApplicationFactory
, the following exception is thrown:To Reproduce
I will try & setup a minimal reproduction soon, as I've only experienced this in a larger project. The general steps would be:
Please provide Code Snippets, Channel type, and any special configuration we will need to reproduce this problem.
N/A
Expected behavior
Any Hosted Services setup by
builder.AddAgent<T>()
should stop gracefully without throwing exceptions when running integration tests withWebApplicationFactory
.Screenshots
N/A
Hosting Information (please complete the following information):
Additional context
N/A
The text was updated successfully, but these errors were encountered: