Skip to content

Commit 260c94e

Browse files
committed
port fixed abort messages from ipykernel
and unskip affected broadcast view tests
1 parent fc1065b commit 260c94e

File tree

2 files changed

+21
-8
lines changed

2 files changed

+21
-8
lines changed

ipyparallel/engine/kernel.py

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -211,3 +211,24 @@ def clear_request(self, stream, idents, parent):
211211
self.session.send(
212212
stream, 'clear_reply', ident=idents, parent=parent, content=content
213213
)
214+
215+
def _send_abort_reply(self, stream, msg, idents):
216+
"""Send a reply to an aborted request"""
217+
# FIXME: forward-port ipython/ipykernel#684
218+
self.log.info(
219+
f"Aborting {msg['header']['msg_id']}: {msg['header']['msg_type']}"
220+
)
221+
reply_type = msg["header"]["msg_type"].rsplit("_", 1)[0] + "_reply"
222+
status = {"status": "aborted"}
223+
md = self.init_metadata(msg)
224+
md = self.finish_metadata(msg, md, status)
225+
md.update(status)
226+
227+
self.session.send(
228+
stream,
229+
reply_type,
230+
metadata=md,
231+
content=status,
232+
parent=msg,
233+
ident=idents,
234+
)

ipyparallel/tests/test_view_broadcast.py

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -30,14 +30,6 @@ def tearDown(self):
3030
if not self._broadcast_view_used:
3131
pytest.skip("No broadcast view used")
3232

33-
@pytest.mark.xfail(reason="aborted replies missing metadata")
34-
def test_abort(self):
35-
pass
36-
37-
@pytest.mark.xfail(reason="aborted replies missing metadata")
38-
def test_abort_all(self):
39-
pass
40-
4133
@needs_map
4234
def test_map(self):
4335
pass

0 commit comments

Comments
 (0)