MCPcopy Index your code
hub / github.com/gopherdata/gophernotes / recvShellReply

Method recvShellReply

kernel_test.go:400–429  ·  view source on GitHub ↗

recvShellReply tries to read a reply message from the shell channel. It will timeout after the given timeout delay. Upon error or timeout, recvShellReply will Fail the test.

(t *testing.T, timeout time.Duration)

Source from the content-addressed store, hash-verified

398// recvShellReply tries to read a reply message from the shell channel. It will timeout after the given
399// timeout delay. Upon error or timeout, recvShellReply will Fail the test.
400func (client *testJupyterClient) recvShellReply(t *testing.T, timeout time.Duration) ComposedMsg {
401 t.Helper()
402
403 ch := make(chan ComposedMsg)
404
405 go func() {
406 repMsgParts, err := client.shellSocket.Recv()
407 if err != nil {
408 t.Fatalf("\t%s Shell socket RecvMessageBytes: %s", failure, err)
409 }
410
411 msgParsed, _, err := WireMsgToComposedMsg(repMsgParts.Frames, []byte(connectionKey))
412 if err != nil {
413 t.Fatalf("\t%s Could not parse wire message: %s", failure, err)
414 }
415
416 ch <- msgParsed
417 }()
418
419 var reply ComposedMsg
420
421 select {
422 case reply = <-ch:
423 return reply
424 case <-time.After(timeout):
425 t.Fatalf("\t%s recvShellReply timed out", failure)
426 }
427
428 return reply
429}
430
431// recvIOSub tries to read a published message from the IOPub channel. It will timeout after the given
432// timeout delay. Upon error or timeout, recvIOSub will Fail the test.

Callers 1

performJupyterRequestMethod · 0.95

Calls 1

WireMsgToComposedMsgFunction · 0.85

Tested by

no test coverage detected