conformance

package
v1.0.0 Latest Latest
Warning

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

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

Documentation

Overview

Package conformance is the worker-protocol conformance suite. It drives a worker of kind "echo" through every protocol path (output, channel writes, dynamic next, usage, retryable and permanent errors, interrupt/resume, claim-checked payloads, long jobs kept alive by heartbeats).

The worker under test implements the echo contract below. By default the Go reference implementation (Echo) runs in-process; set PT_CONFORMANCE_WORKER to a command to test another SDK instead: it is started with NATS_URL and PACKTRAIL_NAMESPACE set and must serve kind "echo" until killed.

Echo contract — the job input (an object) drives the behaviour:

sleep_ms      sleep this long first (exercises heartbeats)
fail_until    {node: n}: that node fails retryably while attempt < n
permanent     fail permanently (no retry)
interrupt     node id: that node interrupts with {"ask": <node>} unless resumed
writes        return as channel writes
next          {node: target}: the dynamic next node of that node
usage         return as usage counters

and the output is {"node", "attempt", "input", "resume"?, "item"?}.

Index

Constants

View Source
const Kind = "echo"

Kind is the worker kind the suite uses.

Variables

This section is empty.

Functions

func Echo

func Echo(ctx context.Context, j *worker.Job) (*worker.Result, error)

Echo is the Go reference implementation of the echo contract.

Types

This section is empty.

Jump to

Keyboard shortcuts

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