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

nbdev_test having issues because of Python caching modules #1370

Open
loayshaqir1 opened this issue Oct 3, 2023 · 0 comments
Open

nbdev_test having issues because of Python caching modules #1370

loayshaqir1 opened this issue Oct 3, 2023 · 0 comments
Labels
bug Something isn't working

Comments

@loayshaqir1
Copy link

No need to add example as the explanation of the issue is simple.
nbdev_test uses up to 8 workers (threads) to run the tests, if we have a library called new_lib for example that its __init__ file has some global variables in it, if we have more than 8 tests, there will be a worker that will run more than one test, and because all the tests do import new_lib, that worker that runs more than one test won't import new_lib again and give the new test a fresh new environment as new_lib is already in sys.modules so because of Python caching modules it won't be imported again.
you should do something that refreshes workers before assigning them new tests

@loayshaqir1 loayshaqir1 added the bug Something isn't working label Oct 3, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant