core: Index | Files

package brokertest

import ""

Package brokertest provides utilities for testing components requiring a live Gazette broker.


Package Files


func CreateJournals Uses

func CreateJournals(t require.TestingT, bk *Broker, specs ...*pb.JournalSpec)

CreateJournals using the Broker Apply API, and wait for them to be allocated.

func Journal Uses

func Journal(spec pb.JournalSpec) *pb.JournalSpec

Journal returns |spec| after applying reasonable test defaults for fields which are not already set.

type Broker Uses

type Broker struct {
    ID     pb.ProcessSpec_ID
    Tasks  *task.Group
    Server *server.Server
    // contains filtered or unexported fields

Broker is a lightweight, embedded Gazette broker suitable for testing client functionality which depends on the availability of the Gazette service.

func NewBroker Uses

func NewBroker(t require.TestingT, etcd *clientv3.Client, zone, suffix string) *Broker

NewBroker builds and returns an in-process Broker identified by |zone| and |suffix|.

func (*Broker) Client Uses

func (b *Broker) Client() pb.RoutedJournalClient

Client returns a RoutedJournalClient wrapping the GRPCLoopback.

func (*Broker) Endpoint Uses

func (b *Broker) Endpoint() pb.Endpoint

Endpoint of the test Broker.

func (*Broker) Signal Uses

func (b *Broker) Signal()

Signal the Broker to exit. Wait on its |Tasks| to confirm it exited. Note other Broker(s) must be available to take over assignments.

func (*Broker) WaitForConsistency Uses

func (b *Broker) WaitForConsistency(ctx context.Context, journal pb.Journal, routeOut *pb.Route) error

WaitForConsistency of the named journal until the Context is cancelled. If |routeOut| is non-nil, it's populated with the current journal Route.

Package brokertest imports 17 packages (graph). Updated 2020-07-08. Refresh now. Tools for package owners.