MCPcopy
hub / github.com/grpc/grpc-go / TestGetSocket

Method TestGetSocket

channelz/service/service_test.go:595–785  ·  channelz/service/service_test.go::s.TestGetSocket
(t *testing.T)

Source from the content-addressed store, hash-verified

593}
594
595func (s) TestGetSocket(t *testing.T) {
596 ss := []*channelz.Socket{newSocket(czSocket{
597 streamsStarted: 10,
598 streamsSucceeded: 2,
599 streamsFailed: 3,
600 messagesSent: 20,
601 messagesReceived: 10,
602 keepAlivesSent: 2,
603 lastLocalStreamCreatedTimestamp: time.Unix(0, 0),
604 lastRemoteStreamCreatedTimestamp: time.Unix(1, 0),
605 lastMessageSentTimestamp: time.Unix(2, 0),
606 lastMessageReceivedTimestamp: time.Unix(3, 0),
607 localFlowControlWindow: 65536,
608 remoteFlowControlWindow: 1024,
609 localAddr: &net.TCPAddr{IP: netip.MustParseAddr("1.0.0.1").AsSlice(), Port: 10001},
610 remoteAddr: &net.TCPAddr{IP: netip.MustParseAddr("12.0.0.1").AsSlice(), Port: 10002},
611 remoteName: "remote.remote",
612 }), newSocket(czSocket{
613 streamsStarted: 10,
614 streamsSucceeded: 2,
615 streamsFailed: 3,
616 messagesSent: 20,
617 messagesReceived: 10,
618 keepAlivesSent: 2,
619 lastLocalStreamCreatedTimestamp: time.Unix(0, 0),
620 lastRemoteStreamCreatedTimestamp: time.Unix(5, 0),
621 lastMessageSentTimestamp: time.Unix(6, 0),
622 lastMessageReceivedTimestamp: time.Unix(7, 0),
623 localFlowControlWindow: 65536,
624 remoteFlowControlWindow: 1024,
625 localAddr: &net.UnixAddr{Name: "file.path", Net: "unix"},
626 remoteAddr: &net.UnixAddr{Name: "another.path", Net: "unix"},
627 remoteName: "remote.remote",
628 }), newSocket(czSocket{
629 streamsStarted: 5,
630 streamsSucceeded: 2,
631 streamsFailed: 3,
632 messagesSent: 20,
633 messagesReceived: 10,
634 keepAlivesSent: 2,
635 lastLocalStreamCreatedTimestamp: time.Unix(10, 10),
636 lastRemoteStreamCreatedTimestamp: time.Unix(0, 0),
637 lastMessageSentTimestamp: time.Unix(0, 0),
638 lastMessageReceivedTimestamp: time.Unix(0, 0),
639 localFlowControlWindow: 65536,
640 remoteFlowControlWindow: 10240,
641 localAddr: &net.IPAddr{IP: netip.MustParseAddr("1.0.0.1").AsSlice()},
642 remoteAddr: &net.IPAddr{IP: netip.MustParseAddr("9.0.0.1").AsSlice()},
643 remoteName: "",
644 }), newSocket(czSocket{
645 localAddr: &net.TCPAddr{IP: netip.MustParseAddr("127.0.0.1").AsSlice(), Port: 10001},
646 }), newSocket(czSocket{
647 security: &credentials.TLSChannelzSecurityValue{
648 StandardName: "TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256",
649 RemoteCertificate: []byte{48, 130, 2, 156, 48, 130, 2, 5, 160},
650 },
651 }), newSocket(czSocket{
652 security: &credentials.OtherChannelzSecurityValue{

Callers

nothing calls this directly

Calls 11

RegisterServerFunction · 0.92
RemoveEntryFunction · 0.92
RegisterSocketFunction · 0.92
newSocketFunction · 0.85
newCZServerFunction · 0.85
escapeFunction · 0.85
addrFunction · 0.70
FatalMethod · 0.65
GetSocketMethod · 0.65
UnmarshalMethod · 0.65
FatalfMethod · 0.65

Tested by

no test coverage detected