Documentation ¶
Index ¶
- func Blast(ctx context.Context, t *testing.T, rawClient raw.Client)
- func Call(ctx context.Context, rawClient raw.Client) error
- func CallUntilSuccess(t *testing.T, rawClient raw.Client, interval time.Duration)
- func Register(dispatcher *yarpc.Dispatcher)
- type TransportSpec
- func (s TransportSpec) NewClient(t *testing.T, addrs []string) (*yarpc.Dispatcher, raw.Client)
- func (s TransportSpec) NewServer(t *testing.T, addr string) (*yarpc.Dispatcher, string)
- func (s TransportSpec) Test(t *testing.T)
- func (s TransportSpec) TestBackoffConnRoundRobin(t *testing.T)
- func (s TransportSpec) TestConcurrentClientsRoundRobin(t *testing.T)
- func (s TransportSpec) TestConnectAndStopRoundRobin(t *testing.T)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CallUntilSuccess ¶
CallUntilSuccess sends a request until it succeeds.
func Register ¶
func Register(dispatcher *yarpc.Dispatcher)
Register registers an echo procedure handler on a dispatcher.
Types ¶
type TransportSpec ¶
type TransportSpec struct { NewServerTransport func(t *testing.T, addr string) peer.Transport NewClientTransport func(t *testing.T) peer.Transport NewInbound func(xport peer.Transport, addr string) transport.Inbound NewUnaryOutbound func(xport peer.Transport, pc peer.Chooser) transport.UnaryOutbound Identify func(addr string) peer.Identifier Addr func(xport peer.Transport, inbound transport.Inbound) string }
TransportSpec specifies how to create test clients and servers for a transport.
func (TransportSpec) NewClient ¶
func (s TransportSpec) NewClient(t *testing.T, addrs []string) (*yarpc.Dispatcher, raw.Client)
NewClient returns a running dispatcher and a raw client for the echo procedure.
func (TransportSpec) NewServer ¶
func (s TransportSpec) NewServer(t *testing.T, addr string) (*yarpc.Dispatcher, string)
NewServer creates an echo server using the given inbound from any transport.
func (TransportSpec) Test ¶
func (s TransportSpec) Test(t *testing.T)
Test runs reusable tests with the transport spec.
func (TransportSpec) TestBackoffConnRoundRobin ¶
func (s TransportSpec) TestBackoffConnRoundRobin(t *testing.T)
TestBackoffConnRoundRobin is a reusable test that any transport can apply to cover connection management backoff.
func (TransportSpec) TestConcurrentClientsRoundRobin ¶
func (s TransportSpec) TestConcurrentClientsRoundRobin(t *testing.T)
TestConcurrentClientsRoundRobin is a reusable test that any transport can apply to cover connection reuse.
func (TransportSpec) TestConnectAndStopRoundRobin ¶
func (s TransportSpec) TestConnectAndStopRoundRobin(t *testing.T)
TestConnectAndStopRoundRobin is a test that any transport can apply to exercise a transport dropping connections if the transport is stopped before a pending request can complete.