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)
| 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. |
| 400 | func (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. |
no test coverage detected