Open frenzymadness opened 7 months ago
Adding -W "always:unclosed <socket.socket:ResourceWarning"
workarounds the problem for me.
So far it has been passing in our environments, we can't support -W error
everywhere.
I have a similar problem now when building the RPM package with version 2.14.1 and Python 3.13 beta 2:
==================================== ERRORS ====================================
____________ ERROR at setup of test_gateway_kernel_lifecycle[False] ____________
> lambda: ihook(item=item, **kwds), when=when, reraise=reraise
)
E pytest.PytestUnraisableExceptionWarning: Exception ignored in: <sqlite3.Connection object at 0x7f34cc959c60>
E
E Traceback (most recent call last):
E File "/usr/lib/python3.13/site-packages/traitlets/traitlets.py", line 1798, in class_traits
E for name, trait in traits.items():
E ~~~~~~~~~~~~^^
E ResourceWarning: unclosed database in <sqlite3.Connection object at 0x7f34cc959c60>
ihook = <HookCaller 'pytest_runtest_setup'>
item = <Function test_gateway_kernel_lifecycle[False]>
kwds = {}
/usr/lib/python3.13/site-packages/flaky/flaky_pytest_plugin.py:146: PytestUnraisableExceptionWarning
---------------------------- Captured stderr setup -----------------------------
[D 2024-07-03 14:36:08.852 ServerApp] Config changed: {'CustomTestTokenRenewer': {'config_var_1': 42, 'config_var_2': 'Use this token value: '}, 'ServerApp': {'jpserver_extensions': {'jupyter_server_terminals': True}}, 'NotebookNotary': {'db_file': ':memory:'}, 'IdentityProvider': {'token': <LazyConfigValue {}>}}
------------------------------ Captured log setup ------------------------------
DEBUG ServerApp:application.py:457 Config changed: {'CustomTestTokenRenewer': {'config_var_1': 42, 'config_var_2': 'Use this token value: '}, 'ServerApp': {'jpserver_extensions': {'jupyter_server_terminals': True}}, 'NotebookNotary': {'db_file': ':memory:'}, 'IdentityProvider': {'token': <LazyConfigValue {}>}}
DEBUG ServerApp:application.py:194 Searching ['/tmp/pytest-of-mockbuild/pytest-0/test_gateway_kernel_lifecycle_0/config', '/builddir/.local/etc/jupyter', '/tmp/pytest-of-mockbuild/pytest-0/test_gateway_kernel_lifecycle_0/env/etc/jupyter', '/tmp/pytest-of-mockbuild/pytest-0/test_gateway_kernel_lifecycle_0/etc/jupyter'] for config files
DEBUG ServerApp:application.py:908 Looking for jupyter_config in /tmp/pytest-of-mockbuild/pytest-0/test_gateway_kernel_lifecycle_0/etc/jupyter
DEBUG ServerApp:application.py:908 Looking for jupyter_config in /tmp/pytest-of-mockbuild/pytest-0/test_gateway_kernel_lifecycle_0/env/etc/jupyter
DEBUG ServerApp:application.py:908 Looking for jupyter_config in /builddir/.local/etc/jupyter
DEBUG ServerApp:application.py:908 Looking for jupyter_config in /tmp/pytest-of-mockbuild/pytest-0/test_gateway_kernel_lifecycle_0/config
DEBUG ServerApp:application.py:457 Config changed: {'CustomTestTokenRenewer': {'config_var_1': 42, 'config_var_2': 'Use this token value: '}, 'ServerApp': {'jpserver_extensions': {'jupyter_server_terminals': True}}, 'NotebookNotary': {'db_file': ':memory:'}, 'IdentityProvider': {'token': <LazyConfigValue {}>}}
DEBUG ServerApp:application.py:908 Looking for jupyter_server_config in /tmp/pytest-of-mockbuild/pytest-0/test_gateway_kernel_lifecycle_0/etc/jupyter
DEBUG ServerApp:application.py:908 Looking for jupyter_server_config in /tmp/pytest-of-mockbuild/pytest-0/test_gateway_kernel_lifecycle_0/env/etc/jupyter
DEBUG ServerApp:application.py:908 Looking for jupyter_server_config in /builddir/.local/etc/jupyter
DEBUG ServerApp:application.py:908 Looking for jupyter_server_config in /tmp/pytest-of-mockbuild/pytest-0/test_gateway_kernel_lifecycle_0/config
DEBUG ServerApp:application.py:457 Config changed: {'CustomTestTokenRenewer': {'config_var_1': 42, 'config_var_2': 'Use this token value: '}, 'ServerApp': {'jpserver_extensions': {'jupyter_server_terminals': True}}, 'NotebookNotary': {'db_file': ':memory:'}, 'IdentityProvider': {'token': <LazyConfigValue {}>}}
DEBUG ServerApp:application.py:457 Config changed: {'CustomTestTokenRenewer': {'config_var_1': 42, 'config_var_2': 'Use this token value: '}, 'ServerApp': {'jpserver_extensions': {'jupyter_server_terminals': True}}, 'NotebookNotary': {'db_file': ':memory:'}, 'IdentityProvider': {'token': <LazyConfigValue {}>}}
INFO ServerApp:serverapp.py:3004 Serving notebooks from local directory: /tmp/pytest-of-mockbuild/pytest-0/test_gateway_kernel_lifecycle_0/root_dir
INFO ServerApp:serverapp.py:3004 Jupyter Server 2.14.1 is running at:
INFO ServerApp:serverapp.py:3004 http://localhost:34399/a%40b/?token=32ee5219deaae093a9e9352ca6b18f1c878314be90a336a8
INFO ServerApp:serverapp.py:3004 http://127.0.0.1:34399/a%40b/?token=32ee5219deaae093a9e9352ca6b18f1c878314be90a336a8
INFO ServerApp:serverapp.py:3004 Kernels will be managed by the Gateway server running at:
INFO ServerApp:serverapp.py:3004 http://mock-gateway-server:8889
INFO ServerApp:serverapp.py:3005 Use Control-C to stop this server and shut down all kernels (twice to skip confirmation).
CRITICAL ServerApp:serverapp.py:3067
To access the server, open this file in a browser:
file:///tmp/pytest-of-mockbuild/pytest-0/test_gateway_kernel_lifecycle_0/runtime/jpserver-1339-open.html
Or copy and paste one of these URLs:
http://localhost:34399/a%40b/?token=32ee5219deaae093a9e9352ca6b18f1c878314be90a336a8
http://127.0.0.1:34399/a%40b/?token=32ee5219deaae093a9e9352ca6b18f1c878314be90a336a8
============================= slowest 10 durations =============================
0.07s setup tests/test_files.py::test_file_types[jupyter_server.files.handlers.FilesHandler]
0.04s call tests/test_files.py::test_contents_manager[jupyter_server.files.handlers.FilesHandler]
0.03s setup tests/test_files.py::test_file_types[jupyter_server.base.handlers.AuthenticatedFileHandler]
0.03s setup tests/test_files.py::test_old_files_redirect[jupyter_server.files.handlers.FilesHandler]
0.03s setup tests/test_files.py::test_save_hooks[jupyter_server.files.handlers.FilesHandler]
0.03s setup tests/test_files.py::test_hidden_files[maybe_hidden0-jupyter_server.base.handlers.AuthenticatedFileHandler]
0.03s setup tests/test_gateway.py::test_gateway_get_named_kernelspec
0.03s setup tests/test_gateway.py::test_gateway_session_lifecycle[True]
0.03s setup tests/test_gateway.py::test_gateway_kernel_lifecycle[False]
0.03s setup tests/test_files.py::test_hidden_files[maybe_hidden3-jupyter_server.base.handlers.AuthenticatedFileHandler]
=========================== short test summary info ============================
ERROR tests/test_gateway.py::test_gateway_kernel_lifecycle[False] - pytest.PytestUnraisableExceptionWarning: Exception ignored in: <sqlite3.Con...
!!!!!!!!!!!!!!!!!!!!!!!!!! stopping after 1 failures !!!!!!!!!!!!!!!!!!!!!!!!!!!
========================= 37 passed, 1 error in 2.77s ==========================
And ignoring PytestUnraisableExceptionWarning
workarounds the problem for me.
Description
I have a problem with version 2.12.5. I'm building it as an RPM package and two tests started to fail after the upgrade.
Output
It seems to be related to this change https://github.com/jupyter-server/jupyter_server/commit/a3a9d3deea7a798d13fe09a41e53f6f825caf21b where the configuration for filterwarnings was adjusted.
I've tested it and it might be a little bit flaky.
test_get_spec
fails for me every time but sometimestest_cull_dead[jp_server_config0]
fails instead oftest_kernel_action_success_event[shutdown]
.