diff --git a/ipykernel/kernelbase.py b/ipykernel/kernelbase.py index 4fe10ffdd..bae127d49 100644 --- a/ipykernel/kernelbase.py +++ b/ipykernel/kernelbase.py @@ -171,7 +171,7 @@ def post_fork_callback(pid, conn): metadata = {} metadata = self.finish_metadata(parent, metadata, reply_content) - self.session.send(stream, u'execute_reply', + self.session.send(stream, u'fork_reply', reply_content, parent, metadata=metadata, ident=ident) diff --git a/ipykernel/tests/test_kernel.py b/ipykernel/tests/test_kernel.py index 7560bcddb..c776b46f5 100644 --- a/ipykernel/tests/test_kernel.py +++ b/ipykernel/tests/test_kernel.py @@ -333,7 +333,7 @@ def test_fork_metadata(): km = kc.parent fork_msg_id = kc.fork() fork_reply = kc.get_shell_msg(block=True, timeout=TIMEOUT) - # validate_message(fork_reply, "execute_reply", fork_msg_id) # TODO: Make it work (need the `fork_reply`) + validate_message(fork_reply, "fork_reply", fork_msg_id) assert fork_msg_id == fork_reply['parent_header']['msg_id'] == fork_msg_id assert fork_reply['content']['conn']['key'] != kc.session.key.decode() fork_pid = fork_reply['content']['pid'] diff --git a/ipykernel/tests/test_message_spec.py b/ipykernel/tests/test_message_spec.py index e75e219c6..fd04399e8 100644 --- a/ipykernel/tests/test_message_spec.py +++ b/ipykernel/tests/test_message_spec.py @@ -195,6 +195,11 @@ class IsCompleteReplyIncomplete(Reference): indent = Unicode() +class ForkReply(Reply): + pid = Integer() + conn = Dict() + + # IOPub messages class ExecuteInput(Reference): @@ -240,6 +245,7 @@ class HistoryReply(Reply): 'stream' : Stream(), 'display_data' : DisplayData(), 'header' : RHeader(), + 'fork_reply' : ForkReply(), } """ Specifications of `content` part of the reply messages.