Skip to content

Commit 9e0dad9

Browse files
committed
skip ipyparallel test on Windows for Python >= 3.7
1 parent ea76909 commit 9e0dad9

1 file changed

Lines changed: 24 additions & 20 deletions

File tree

adaptive/tests/test_runner.py

Lines changed: 24 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import asyncio
2-
import os
2+
import platform
33
import sys
44
import time
55

@@ -17,6 +17,8 @@
1717
with_ipyparallel,
1818
)
1919

20+
OPERATING_SYSTEM = platform.system()
21+
2022

2123
def blocking_runner(learner, goal):
2224
BlockingRunner(learner, goal, executor=SequentialExecutor())
@@ -71,22 +73,6 @@ async def f(x):
7173
# --- Test with different executors
7274

7375

74-
@pytest.fixture(scope="session")
75-
def ipyparallel_executor():
76-
from ipyparallel import Client
77-
78-
if os.name == "nt":
79-
import wexpect as expect
80-
else:
81-
import pexpect as expect
82-
83-
child = expect.spawn("ipcluster start -n 1")
84-
child.expect("Engines appear to have started successfully", timeout=35)
85-
yield Client()
86-
if not child.terminate(force=True):
87-
raise RuntimeError("Could not stop ipcluster")
88-
89-
9076
@pytest.fixture(scope="session")
9177
def loky_executor():
9278
import loky
@@ -117,17 +103,35 @@ def test_stop_after_goal():
117103

118104

119105
@pytest.mark.skipif(not with_ipyparallel, reason="IPyparallel is not installed")
120-
def test_ipyparallel_executor(ipyparallel_executor):
106+
@pytest.mark.skipif(
107+
OPERATING_SYSTEM == "Windows" and sys.version_info >= (3, 7),
108+
reason="Gets stuck in CI",
109+
)
110+
def test_ipyparallel_executor():
111+
from ipyparallel import Client
112+
113+
if OPERATING_SYSTEM == "Windows":
114+
import wexpect as expect
115+
else:
116+
import pexpect as expect
117+
118+
child = expect.spawn("ipcluster start -n 1")
119+
child.expect("Engines appear to have started successfully", timeout=35)
120+
ipyparallel_executor = Client()
121121
learner = Learner1D(linear, (-1, 1))
122122
BlockingRunner(learner, trivial_goal, executor=ipyparallel_executor)
123+
123124
assert learner.npoints > 0
124125

126+
if not child.terminate(force=True):
127+
raise RuntimeError("Could not stop ipcluster")
128+
125129

126130
@flaky.flaky(max_runs=5)
127131
@pytest.mark.timeout(60)
128132
@pytest.mark.skipif(not with_distributed, reason="dask.distributed is not installed")
129-
@pytest.mark.skipif(os.name == "nt", reason="XXX: seems to always fail")
130-
@pytest.mark.skipif(sys.platform == "darwin", reason="XXX: intermittently fails")
133+
@pytest.mark.skipif(OPERATING_SYSTEM == "Windows", reason="XXX: seems to always fail")
134+
@pytest.mark.skipif(OPERATING_SYSTEM == "Darwin", reason="XXX: intermittently fails")
131135
def test_distributed_executor():
132136
from distributed import Client
133137

0 commit comments

Comments
 (0)