Skip to content

Commit

Permalink
Test usage of proactor event loop
Browse files Browse the repository at this point in the history
  • Loading branch information
blink1073 committed Nov 10, 2023
1 parent 9579862 commit 3c1c2a7
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 18 deletions.
10 changes: 5 additions & 5 deletions .github/workflows/downstream.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ on:

jobs:
nbclassic:
runs-on: ubuntu-latest
runs-on: windows-latest
timeout-minutes: 10

steps:
Expand Down Expand Up @@ -37,7 +37,7 @@ jobs:
wait $TASK_PID
notebook:
runs-on: ubuntu-latest
runs-on: windows-latest
timeout-minutes: 10

steps:
Expand All @@ -55,7 +55,7 @@ jobs:
test_command: pip install pytest-jupyter[server] && pytest -vv -raXxs -W default --durations 10 --color=yes

jupyterlab_server:
runs-on: ubuntu-latest
runs-on: windows-latest
timeout-minutes: 10

steps:
Expand All @@ -74,7 +74,7 @@ jobs:
test_command: pip install pytest-jupyter[server] && pytest -vv -raXxs -W default --durations 10 --color=yes

jupyterlab:
runs-on: ubuntu-latest
runs-on: windows-latest
timeout-minutes: 10

steps:
Expand All @@ -91,7 +91,7 @@ jobs:
test_command: "python -m jupyterlab.browser_check --no-browser-test"

jupyter_server_terminals:
runs-on: ubuntu-latest
runs-on: windows-latest
timeout-minutes: 10

steps:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/python-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ jobs:
test_minimum_versions:
name: Test Minimum Versions
timeout-minutes: 20
runs-on: ubuntu-latest
runs-on: windows-latest
steps:
- uses: actions/checkout@v4
- uses: jupyterlab/maintainer-tools/.github/actions/base-setup@v1
Expand Down
25 changes: 13 additions & 12 deletions jupyter_server/serverapp.py
Original file line number Diff line number Diff line change
Expand Up @@ -2529,18 +2529,19 @@ def _init_asyncio_patch() -> None:
at least until asyncio adds *_reader methods
to proactor.
"""
if sys.platform.startswith("win") and sys.version_info >= (3, 8):
import asyncio

try:
from asyncio import WindowsProactorEventLoopPolicy, WindowsSelectorEventLoopPolicy
except ImportError:
pass
# not affected
else:
if type(asyncio.get_event_loop_policy()) is WindowsProactorEventLoopPolicy:
# prefer Selector to Proactor for tornado + pyzmq
asyncio.set_event_loop_policy(WindowsSelectorEventLoopPolicy())
pass
# if sys.platform.startswith("win") and sys.version_info >= (3, 8):
# import asyncio

# try:
# from asyncio import WindowsProactorEventLoopPolicy, WindowsSelectorEventLoopPolicy
# except ImportError:
# pass
# # not affected
# else:
# if type(asyncio.get_event_loop_policy()) is WindowsProactorEventLoopPolicy:
# # prefer Selector to Proactor for tornado + pyzmq
# asyncio.set_event_loop_policy(WindowsSelectorEventLoopPolicy())

@catch_config_error
def initialize(
Expand Down

0 comments on commit 3c1c2a7

Please sign in to comment.