Skip to content

Commit

Permalink
Test with client 8 updates (jupyter-server#988)
Browse files Browse the repository at this point in the history
  • Loading branch information
blink1073 committed Sep 25, 2022
1 parent 507c697 commit 23f03fc
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 3 deletions.
4 changes: 4 additions & 0 deletions .github/workflows/integration-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,10 @@ jobs:
- name: Run the tests
run: |
pytest -vv --integration_tests=true tests
- name: Run the tests
run: |
pip install jupyter_client@https://github.com/blink1073/jupyter_client/archive/refs/heads/synchronous_managers.zip
pytest -vv --integration_tests=true tests
integration_check: # This job does nothing and is only used for the branch protection
if: always()
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/python-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,7 @@ jobs:
pip check
- name: Run the tests
run: |
pip install jupyter_client@https://github.com/blink1073/jupyter_client/archive/refs/heads/synchronous_managers.zip
pytest -vv || pytest -vv --lf
make_sdist:
Expand Down
10 changes: 7 additions & 3 deletions jupyter_server/services/kernels/handlers.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
"""
# Copyright (c) Jupyter Development Team.
# Distributed under the terms of the Modified BSD License.
import asyncio
import json
from textwrap import dedent
from traceback import format_tb
Expand All @@ -15,8 +16,9 @@
except ImportError:
from jupyter_client.jsonutil import date_default as json_default

from concurrent.futures import Future

from tornado import gen, web
from tornado.concurrent import Future
from tornado.ioloop import IOLoop

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

kernel_id = await km.start_kernel(kernel_name=model["name"], path=model.get("path"))
kernel_id = await ensure_async(
km.start_kernel(kernel_name=model["name"], path=model.get("path"))
)
model = await ensure_async(km.kernel_model(kernel_id))
location = url_path_join(self.base_url, "api", "kernels", url_escape(kernel_id))
self.set_header("Location", location)
Expand Down Expand Up @@ -404,7 +408,7 @@ def give_up():
loop = IOLoop.current()
loop.add_timeout(loop.time() + self.kernel_info_timeout, give_up)
# actually wait for it
await future
await asyncio.wrap_future(future)

async def get(self, kernel_id):
self.kernel_id = kernel_id
Expand Down

0 comments on commit 23f03fc

Please sign in to comment.