storedir

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Oct 13, 2026 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Overview

Package storedir gives a test a directory for the embedded message broker's store. It imports nothing from the repository, so internal/mq's own tests can use it.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func New

func New(t testing.TB) string

New returns an empty directory under t.TempDir for a broker's store, removed once the broker is closed: New's cleanup runs after the test's own, Close among them (cleanups run last-in, first-out).

A closed broker's store is not yet quiescent: the embedded NATS server writes each durable consumer's state from a goroutine its Shutdown does not join, so a write under way can land after Close has returned — failing t.TempDir's one-shot RemoveAll with "directory not empty" (#442). There is nothing to wait on, so the removal is tried again whenever a directory was refilled between reading and removing it. That ends without a clock: those writes add a bounded number of entries, and none once their directory is gone.

Types

This section is empty.

Jump to

Keyboard shortcuts

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