conformancetest

package
v1.19.0 Latest Latest
Warning

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

Go to latest
Published: Jul 24, 2026 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Overview

Package conformancetest exposes the canonical correctness suites every distributed driver must pass.

The suites live in a subpackage so the production-code path `internal/distributed` does not import the standard library `testing` package (precedent: `internal/state/conformancetest`, `internal/artifacts/conformancetest`, `internal/tasks/conformancetest`).

Two top-level Run functions:

RunBus(t, factory)            — MessageBus correctness
RunRemoteTransport(t, factory) — RemoteTransport correctness

Downstream drivers (post-V1 durable bus, A2A wire RemoteTransport) wire their own *_test.go that calls the matching Run.

The RemoteTransport factory returns a transport plus an `AgentBinding` callback so tests can stage Agents (the `internal/distributed/drivers/loopback` Agent abstraction). Drivers that cannot stage Agents (because they connect to a real network) MAY supply a no-op binding; subtests requiring a staged Agent will `t.Skip` in that case.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func RunBus

func RunBus(t *testing.T, factory BusFactory)

RunBus executes the canonical MessageBus correctness suite.

Subtests:

  • Publish_AtLeastOnce_DeliversToSubscribers
  • Publish_Identity_Mandatory
  • Publish_AfterClose_Errors
  • Concurrent_Publish_NoRace
  • GoroutineLeak_AfterClose

func RunRemoteTransport

func RunRemoteTransport(t *testing.T, factory RemoteTransportFactory)

RunRemoteTransport executes the canonical RemoteTransport correctness suite.

Subtests:

  • Send_RoundTrip
  • Send_Identity_Mandatory
  • Stream_OrderedEventsWithDoneTrue
  • Stream_RespectsClose
  • GetTask_RoundTrip
  • GetTask_NotFound
  • ListTasks_FilterApplied
  • Cancel_TerminalState
  • Subscribe_DeliversArtifactAndStatusUpdates
  • Subscribe_RespectsClose
  • PushNotificationConfig_Crud_RoundTrip
  • GetExtendedAgentCard_HappyPath
  • Concurrent_Send_NoRace
  • GoroutineLeak_AfterClose

Types

type AgentBinding

type AgentBinding func(url string, agent loopback.Agent)

AgentBinding installs an Agent for a target URL on the test's transport. Returns the URL the conformance subtests should use for req.AgentURL when calling Send / Stream / etc.

type BusFactory

type BusFactory func(t *testing.T) (bus distributed.MessageBus, eb events.EventBus, cleanup func())

BusFactory builds a fresh MessageBus paired with the EventBus it projects onto (the conformance suite subscribes there to observe delivery), and a cleanup callback. Drivers free to share an EventBus instance across N invocations; cleanup MUST close both.

Factories MUST configure the projected EventBus with SubscriberBufferSize >= 100 (the suite's concurrent-publish volume): bounded event buses drop oldest under saturation, so a smaller buffer makes the suite's zero-loss assertion impossible to satisfy and the test re-flakes as permanent message loss. Concurrent_Publish_NoRace enforces this mechanically via a DroppedTotal()==0 check when the EventBus implements events.DroppedCounter.

type RemoteTransportFactory

type RemoteTransportFactory func(t *testing.T) (transport distributed.RemoteTransport, binding AgentBinding, cleanup func())

RemoteTransportFactory builds a fresh RemoteTransport plus an AgentBinding callback the conformance suite uses to stage a stub Agent. Drivers that cannot stage Agents (real-network drivers) supply a nil binding; the relevant subtests skip in that case.

`cleanup` is called at the end of each subtest; it MUST close the transport.

Jump to

Keyboard shortcuts

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