queuetest

package
v0.10.0 Latest Latest
Warning

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

Go to latest
Published: Apr 16, 2026 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Overview

Package queuetest provides a backend-agnostic conformance test suite for queue.Service implementations and a deterministic FakeClock for use in backend-specific tests.

Each backend's test file calls queuetest.Run with a factory that produces a fresh queue.Service per sub-test. The suite covers FIFO, priority, delay, retry, dead letter routing, concurrency, panic recovery, visibility-timeout recovery, and graceful shutdown.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Run

func Run(t *testing.T, factory Factory)

Run executes the conformance suite against a backend.

Types

type Factory

type Factory func(t *testing.T) (svc queue.Service, teardown func())

Factory produces a fresh queue.Service per sub-test along with a teardown function. The factory is responsible for using a unique namespace per call so durable backends do not bleed state between sub-tests.

type FakeClock

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

FakeClock is a deterministic Clock controlled by tests.

func NewFakeClock

func NewFakeClock(t time.Time) *FakeClock

NewFakeClock returns a FakeClock anchored at t (zero time = time.Unix(0,0)).

func (*FakeClock) Advance

func (c *FakeClock) Advance(d time.Duration)

Advance moves the clock forward by d, firing any timers whose deadline has elapsed.

func (*FakeClock) NewTimer

func (c *FakeClock) NewTimer(d time.Duration) queue.Timer

NewTimer creates a queue.Timer that fires after d (relative to the current fake time).

func (*FakeClock) Now

func (c *FakeClock) Now() time.Time

Now returns the current fake time.

Jump to

Keyboard shortcuts

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