When kernels are culled, the kernel is terminated in the background,
unbeknownst to the session management. As a result, invalid sessions
can be produced that appear to exist, yet cannot produce a model from
the persisted row due to the associated kernel no longer being active.
Prior to this change, these sessions, when encountered via a subsequent
call to `get_session()`, would be deleted and a KeyError would be raised.
This change updates the existence check to tolerate those kinds of sessions.
It removes such sessions (as would happen previously), but rather than
raise a KeyError when attempting to convert the row to a dictionary,
it logs a warning and returns None, which then allows `session_exists()`
to return False since the session was removed (as was ultimately the
case previously).
Calls to `get_session()` remain just as before and have the potential
to raise `KeyError` in such cases. The difference now being that the
`KeyError` is accompanied by a message indicating the cause.
Fixes#4209
As per issue #3335, we want all js tests migrated to selenium. This change migrates the test of buffered execution requests.
Test Plan:
py.test -v notebook/tests/selenium/test_buffering.py
Attempts to fix flakiness in `test_display_isolation`. We now ensure the iframe has been added to the dom before calling the selector. To make this work, we clean up the iframe cells (and all other cells) at the end of each test. I'm not 100% positive this fixes, since I haven't been able to reproduce the failure. But the hope is that this fixes the intermittent failing seen in https://github.com/jupyter/notebook/pull/4182.
- use %r instead of %s to handle quoting more succintly
- add a finally block to ensure browser state is transitioned from iframe back to default content
As per issue #3335, we want all js tests migrated to selenium. This change migrates and extends the svg isolation test (extended to include slightly more thorough validation of expected isolation behavior).
Test Plan:
py.test -v notebook/tests/selenium/test_display_isolation.py
Migrates a single js test (testing image display functionality) to selenium as per issue #3335.
Test Plan:
py.test -v notebook/tests/selenium/test_display_image.py
Currently the default URL message given on the console on startup is:
---
Copy/paste this URL into your browser when you connect for the first time,
to login with a token:
http://(myip.com or 127.0.0.1):8888/?token=8fdc8 ...
---
This will always need editing to use. Replace with one host IP (e.g. 'myip.com')
option and one local ip (127.0.0.1) option to make it copy/pastable again.
Currently the default URL message given on the console on startup is:
---
Copy/paste this URL into your browser when you connect for the first time,
to login with a token:
http://(myip.com or 127.0.0.1):8888/?token=8fdc8 ...
---
This will always need editing to use. Replace with host IP (e.g. 'myip.com')
to make it copy/pastable again.
This allows slower contents managers to not block the event loop by allowing
more of their API to return futures.
Other usages of contents manager functions are already wrapped in maybe_future,
including a use of `file_exists` in contents/handlers.py
Suppressed some capital letters because doesn't look right in French
Changed "De Confiance" to "Fiable" because the formulation is odd, "De Confiance" sounds a bit like "Is Trusted" , when "Fiable" can directly be translated to "Trusted" (and therefore the change from "Sans confiance" to "Non Fiable")
Changed from "de" to "du" when it was uncorrectly used
Recently I needed to troubleshoot kernel responses and found it helpful
to distinguish status types (busy vs. idle) - thought others might find
it useful as well.
Entries that previously appeared as...
```
activity on 33383dcc-c054-4dc0-b842-16063ea160fe: status
activity on 33383dcc-c054-4dc0-b842-16063ea160fe: status
activity on 33383dcc-c054-4dc0-b842-16063ea160fe: status
activity on 33383dcc-c054-4dc0-b842-16063ea160fe: status
activity on 33383dcc-c054-4dc0-b842-16063ea160fe: execute_input
activity on 33383dcc-c054-4dc0-b842-16063ea160fe: display_data
activity on 33383dcc-c054-4dc0-b842-16063ea160fe: execute_result
activity on 33383dcc-c054-4dc0-b842-16063ea160fe: status
```
will now appear as...
```
activity on 33383dcc-c054-4dc0-b842-16063ea160fe: status (idle)
activity on 33383dcc-c054-4dc0-b842-16063ea160fe: status (busy)
activity on 33383dcc-c054-4dc0-b842-16063ea160fe: status (idle)
activity on 33383dcc-c054-4dc0-b842-16063ea160fe: status (busy)
activity on 33383dcc-c054-4dc0-b842-16063ea160fe: execute_input
activity on 33383dcc-c054-4dc0-b842-16063ea160fe: display_data
activity on 33383dcc-c054-4dc0-b842-16063ea160fe: execute_result
activity on 33383dcc-c054-4dc0-b842-16063ea160fe: status (idle)
```