backendtest

package
v0.37.1 Latest Latest
Warning

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

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

Documentation

Overview

Package backendtest provides a shared conformance suite that every backend.Backend implementation must pass, proving the implementations are interchangeable (DESIGN.md §2: "backends are interchangeable behind backend.Backend").

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AtomicConditionalPut added in v0.33.0

func AtomicConditionalPut(h http.Handler) http.Handler

AtomicConditionalPut wraps an S3-compatible test server's handler, serializing every request that carries an If-None-Match precondition. Real S3 evaluates a conditional PUT atomically; the embeddable go-faster/fs server (as of v0.3.0) checks the precondition and performs the write as two separate steps, so two concurrent "If-None-Match: *" PUTs can both observe the key absent and both succeed — a TOCTOU race the conformance suite's single-winner CAS test rightly rejects. Serializing just the conditional requests restores real-S3 semantics for the tests without patching the fake. (Worth fixing upstream; this wrapper is then a no-op.)

func Run

func Run(t *testing.T, factory func(t *testing.T) backend.Backend)

Run executes the full conformance suite against a backend produced by factory — the object operations plus the conditional-write (CAS) [Backend.PutIfAbsent]. Each subtest gets a fresh, empty backend. Call it from each implementation's test package.

Types

This section is empty.

Jump to

Keyboard shortcuts

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