-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
20.12.0 causes the parallel unittest fails with 'app ... already in use' #1989
Comments
The simplest way to fix this would be to give each of the apps in your test a unique name. import uuid
Sanic(uuid.uuid4()) Newest build adds a feature where the instance is stored in an internal class registry for later retrieval:
We should probably add a patch that will disable this feature. It should be available both as a config:
and on the instance itself
Also, there should be a way to remove an app from the registry (for example as a part of a unittest teardown). |
Thanks a lot @ahopkins for your prompt response. |
* Bump to v20.12 * Update Changelog * Add disable app registry * squash
v20.12.1 will have this feature. |
Let let us know if this issue fixed! Thanks, team! |
Yes. In your Sanic.test_mode = True Or, set an env variable in your test suite: I will be releasing |
Thanks @ahopkins worked for my issue |
@ahopkins When do you expect |
I was planning on doing that tonight, but didn't quite get to it. I am shooting for an initial release tomorrow, and getting #1850 ready to merge to |
released. Changes to come, but it's out there. |
After updating to the latest sanic 20.12.0, my pytest tests are failing with following error:
sanic.exceptions.SanicException: Sanic app name 'xxxxxx' already in use.
I reverted back to 20.9.0, and the issue was fixed. What has changed in the recent version that has caused this issue to happen?
The text was updated successfully, but these errors were encountered: