websocket
README.md

Client shutdown qualification #

Run just conformance-tools, then just conformance and just conformance --optimize ReleaseSafe. --suite shutdown selects only the wire checks for iteration. Docker, uv, just, and a system Python are required.

The gate runs the library tests and 41 real TLS/WebSocket cases across Threaded, zio with one and four executors, and zio from native callers. A cooperating peer must observe the masked WebSocket close frame followed by TLS close_notify. Tests also cover concurrent readers and writers, cancellation during reads and partial writes, backpressured close, external cancellation of close, expired budgets, and Threaded concurrency exhaustion. Failed or canceled partial writes must reject subsequent writes. All futures must join before the client is freed.

Timeout/abort cases require their specific error; arbitrary I/O errors, fixture failures, crashes, or harness timeouts fail the gate. A blocked-close timer covers lock acquisition and protocol writes together. A separate heartbeat verifies that network waiting does not occupy the sole zio executor. TLS setup and payload preparation occur before these timing measurements.

The tool image pins Zig 0.17.0, Python, uv, zio, zlib, and pmdeflate. Tools and dependencies are prepared before target execution. During tests there is no external network, credentials, host home, or Docker socket. Source/tools are read-only; only bounded scratch space is writable. CPU, memory, process count, files, and phase wall time are limited. The driver prints the source fingerprint, immutable image ID, optimization mode, suite, and zio package used.

For compatibility qualification, --zio-source accepts either pinned package name from the driver, including the upstream 3bbd74d package used by zlay. The provided directory is mounted read-only and the snapshot manifest selects that package; production manifests are unchanged.

This is a client shutdown profile, not an exhaustive RFC 6455 or TLS suite. It qualifies the outgoing close frame/alert and local task/buffer lifetime; it does not require waiting for the peer's close reply. Synchronous CPU work remains cooperative. The library's existing tests cover additional framing behavior.

Local Linux aarch64 qualification passed all 71 library tests and 41 shutdown cases in Debug and ReleaseSafe. The 41 shutdown cases also passed in Debug with the upstream 3bbd74d zio package. Shutdown probes use a thread-safe debug allocator and fail on leaked allocations in both optimization modes.