-
Notifications
You must be signed in to change notification settings - Fork 506
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
Running the tests locally doesn't clean up kernels #231
Comments
Isn't it annoying that it would shutdown all the kernels? Not only the ones that were spawned by the tests? |
Indeed. Ideally it should only shut down the kernels spawned during the tests. |
But this |
It might be difficult to keep track over which kernels were spawned by voila though. I see that the kernel config files are in |
Oh ok cool! |
Actually, isn't it an issue of pytest-tornado? Shouldn't it stop all ioloops when tests are done? |
I tried something like that in the @pytest.fixture(autouse=True, scope='module')
def shutdown_kernels():
# Setup
yield
# Teardown
current = tornado.ioloop.IOLoop.current(False)
if current:
current.stop() But it breaks
other tests are passing. I'll dig a bit more tomorrow. |
I also wasn't sure if |
This is because the custom Voila class https://github.com/QuantStack/voila/blob/6a1d9793b769ff3aad929b0497b9dcd4b6f41569/tests/app/conftest.py#L10 overrides listen(). We could move the shutdown of kernels from Voila.listen to Voila.start maybe? |
Or move the |
This does not seem to work. I feel like because the
I tried, it makes the tests fail a bit randomly (I feel like one out of two is passing, but I'm not sure). They are failing with |
ok will try to reproduce that. |
Running the tests locally spins up a lot of kernels but the kernels are not properly terminated at the end of the run.
Steps
python -m pytest
ps auxf | grep voila
Maybe something like
kernel_manager.shutdown_all()
could be used to shut down all the kernels when the tests are over:https://github.com/QuantStack/voila/blob/57182a943c18813d13f295cf11224301f6757f4f/voila/app.py#L466
The text was updated successfully, but these errors were encountered: