integrationtest

package
v1.42.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 31, 2019 License: MIT Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Blast

func Blast(ctx context.Context, t *testing.T, rawClient raw.Client)

Blast sends a blast of calls to the client and verifies that they do not err.

func Call

func Call(ctx context.Context, rawClient raw.Client) error

Call sends an echo request to the client.

func CallUntilSuccess

func CallUntilSuccess(t *testing.T, rawClient raw.Client, interval time.Duration)

CallUntilSuccess sends a request until it succeeds.

func Register

func Register(dispatcher *yarpc.Dispatcher)

Register registers an echo procedure handler on a dispatcher.

func Timeout added in v1.32.0

func Timeout(ctx context.Context, rawClient raw.Client) error

Timeout sends a request to the client, which will timeout on the server.

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.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL