Documentation
¶
Overview ¶
Package mqtest is the conformance suite for mq.Broker: the behavior the rest of the process relies on, stated once and run by every implementation from its own tests. The cases address events by mq.Topic alone and assume no layout — no stream, subject or partition names — so a backend passes by behaving, not by being built like the embedded one. Where backends legitimately differ, a Caps flag says which way; nothing else is optional.
Index ¶
Constants ¶
View Source
const ( // Acme and Globex are the tenants Harness.New makes ready to publish. Acme tenant.ID = "acme" Globex tenant.ID = "globex" // Durable is the consumer the suite creates, consumes and purges by: the // ingest worker's (ingest.BufferConsumerName), so a backend that only // finds durables an operator made has one to find. Durable = "buffer-consumer" )
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Caps ¶
type Caps struct {
// PerTenantBudget: a full queue refuses its own tenant alone, so Fill on
// one tenant leaves another publishing.
PerTenantBudget bool
// PurgesAcked: PurgeAcked removes acknowledged events past the cutoff,
// rather than leaving retention to the broker's operator.
PurgesAcked bool
// UnbudgetedNotFound: DeadLetterCounts of a tenant never given a budget
// is mq.ErrNoDeadLetterQueue rather than zero counts.
UnbudgetedNotFound bool
// ConfiguresDurables: CreateConsumer applies cfg.AckWait to the durable,
// rather than checking it against one the operator configured.
ConfiguresDurables bool
}
Caps records where a backend's semantics legitimately differ.
type Harness ¶
type Harness struct {
// New returns a fresh broker, isolated from every other New's, in which
// Acme and Globex can publish, budgets already applied as the wiring
// would. Its cleanup is registered on t and must tolerate the broker
// having been closed already.
New func(t *testing.T) mq.Broker
// EndDelivery ends delivery underneath a running consumer of Durable, as
// the broker's operator or the network could (the #587 failure path):
// deleting the durable, or closing the connection for good.
EndDelivery func(t *testing.T, b mq.Broker)
// Fill makes the next Publish for id refuse with mq.ErrQueueFull. nil
// skips the cases that need it.
Fill func(t *testing.T, b mq.Broker, id tenant.ID)
Caps Caps
}
Harness is what a backend gives the suite.
Click to show internal directories.
Click to hide internal directories.