Skip to content

Commit c88846c

Browse files
authored
Test with client 8 updates (#988)
1 parent 98b4285 commit c88846c

File tree

3 files changed

+12
-3
lines changed

3 files changed

+12
-3
lines changed

.github/workflows/integration-tests.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,10 @@ jobs:
2828
- name: Run the tests
2929
run: |
3030
pytest -vv --integration_tests=true tests
31+
- name: Run the tests
32+
run: |
33+
pip install jupyter_client@https://github.com/blink1073/jupyter_client/archive/refs/heads/synchronous_managers.zip
34+
pytest -vv --integration_tests=true tests
3135
3236
integration_check: # This job does nothing and is only used for the branch protection
3337
if: always()

.github/workflows/python-tests.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -125,6 +125,7 @@ jobs:
125125
pip check
126126
- name: Run the tests
127127
run: |
128+
pip install jupyter_client@https://github.com/blink1073/jupyter_client/archive/refs/heads/synchronous_managers.zip
128129
pytest -vv || pytest -vv --lf
129130
130131
make_sdist:

jupyter_server/services/kernels/handlers.py

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
"""
55
# Copyright (c) Jupyter Development Team.
66
# Distributed under the terms of the Modified BSD License.
7+
import asyncio
78
import json
89
from textwrap import dedent
910
from traceback import format_tb
@@ -15,8 +16,9 @@
1516
except ImportError:
1617
from jupyter_client.jsonutil import date_default as json_default
1718

19+
from concurrent.futures import Future
20+
1821
from tornado import gen, web
19-
from tornado.concurrent import Future
2022
from tornado.ioloop import IOLoop
2123

2224
from jupyter_server.auth import authorized
@@ -55,7 +57,9 @@ async def post(self):
5557
else:
5658
model.setdefault("name", km.default_kernel_name)
5759

58-
kernel_id = await km.start_kernel(kernel_name=model["name"], path=model.get("path"))
60+
kernel_id = await ensure_async(
61+
km.start_kernel(kernel_name=model["name"], path=model.get("path"))
62+
)
5963
model = await ensure_async(km.kernel_model(kernel_id))
6064
location = url_path_join(self.base_url, "api", "kernels", url_escape(kernel_id))
6165
self.set_header("Location", location)
@@ -404,7 +408,7 @@ def give_up():
404408
loop = IOLoop.current()
405409
loop.add_timeout(loop.time() + self.kernel_info_timeout, give_up)
406410
# actually wait for it
407-
await future
411+
await asyncio.wrap_future(future)
408412

409413
async def get(self, kernel_id):
410414
self.kernel_id = kernel_id

0 commit comments

Comments
 (0)