queuetest

package
v6.0.1+incompatible Latest Latest
Warning

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

Go to latest
Published: Dec 2, 2017 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Overview

Package queuetest provides common functionality tests all queue implementations must pass. These tests guarantee a queue fits well into the publisher pipeline.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func TestMultiProducerConsumer

func TestMultiProducerConsumer(
	t *testing.T,
	events, batchSize int,
	factory QueueFactory,
)

func TestProducerCancelRemovesEvents

func TestProducerCancelRemovesEvents(t *testing.T, factory QueueFactory)

TestSingleProducerConsumer tests buffered events for a producer getting cancelled will not be consumed anymore. Concurrent producer/consumer pairs might still have active events not yet ACKed (not tested here).

Note: queues not requiring consumers to ACK a events in order to

return ACKs to the producer are not supported by this test.

func TestSingleProducerConsumer

func TestSingleProducerConsumer(
	t *testing.T,
	events, batchSize int,
	factory QueueFactory,
)

Types

type QueueFactory

type QueueFactory func() queue.Queue

type TestLogger

type TestLogger struct {
	// contains filtered or unexported fields
}

func NewTestLogger

func NewTestLogger(t *testing.T) *TestLogger

NewTestLogger creates a new logger interface, logging via t.Log/t.Logf. If `-debug` is given on command line, debug logs will be included. Run tests with `-debug-print`, to print log output to console right away. This guarantees logs are still written if the test logs are not printed due to a panic in the test itself.

Capturing log output using the TestLogger, will make the log output correctly display with test test being run.

func (*TestLogger) Debug

func (l *TestLogger) Debug(vs ...interface{})

func (*TestLogger) Debugf

func (l *TestLogger) Debugf(format string, v ...interface{})

func (*TestLogger) Err

func (l *TestLogger) Err(vs ...interface{})

func (*TestLogger) Errf

func (l *TestLogger) Errf(format string, v ...interface{})

func (*TestLogger) Info

func (l *TestLogger) Info(vs ...interface{})

func (*TestLogger) Infof

func (l *TestLogger) Infof(format string, v ...interface{})

Jump to

Keyboard shortcuts

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