conformance

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Jul 13, 2026 License: MIT Imports: 6 Imported by: 0

Documentation

Overview

Package conformance is a shared test suite every gateway.Outbox implementation must pass, so gateway.MemoryOutbox and persistence/redis.Outbox (and any third-party implementation) are held to the exact same at-least-once contract: a message is retained once appended, stamped with a per-connection id and sequence the Outbox itself mints in append order, remains readable until acknowledged, is redeliverable in Seq order, disappears only on Ack or DropConn, and rejects an Ack whose generation trails one already accepted for the same connection. An implementation that drops an unacknowledged message early would silently lose the tail a reconnecting client depends on; one that let two messages share a Seq would let a Seq-deduping client silently discard one; one that accepted a stale-generation Ack would let a node already fenced out by an owner-lease takeover (see gateway.WithOwnerLease) keep draining the tail out from under its successor.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Run

func Run(t *testing.T, factory func(t *testing.T) gateway.Outbox)

Run exercises factory() against the gateway.Outbox contract. factory must return a fresh, empty Outbox; Run calls it once per subtest so implementations backed by a shared external service (e.g. Redis) do not see state leak between subtests as long as factory picks a fresh key namespace or database per call.

Types

This section is empty.

Jump to

Keyboard shortcuts

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