gw-05 — Verification

One command

cd gw-05-websockets-pushy && bash scripts/verify.sh

What the tests prove

TestInvariant
TestAcceptKeythe RFC 6455 §1.3 accept-key derivation is exact
TestFrameRoundTripMaskedmasked client→server frames encode/decode (unmask) correctly
TestHandshakeAndMessagefull upgrade handshake + a request/response message over a real connection
TestPingAutoPonga ping is auto-answered with a pong on the wire (app-layer keepalive)
TestRegistryTTLregistry entries expire (crashed-node cleanup; expired = miss)
TestDeliveryRoutinga published event is routed to the owning node purely via registry lookup
TestRegistryMissPolicya push to an unconnected device is a counted miss, not a crash
TestSlowConsumerIsolationa full per-device queue drops (doesn't block); other devices unaffected
TestReconnectJitterSpreadfull-jitter reconnect delays spread across all buckets (no stampede)
TestAtLeastOnceDedupa redelivered MsgID is suppressed (idempotent client)
TestBackoffWithinCapexponential backoff with jitter stays within the cap

All under -race with a 60s timeout (the timeout guards against the net.Pipe-style deadlocks discussed in GUIDE §1).

What "green" does NOT guarantee

  • No TLS / device identity. Production terminates TLS and authenticates each connection (gw-07).
  • In-memory registry. A real registry is a replicated KV with a reconciliation sweep (GUIDE §7.3).
  • No full drain loop wired in. drain.go provides the primitives; wiring SIGTERM → reconnect signals → bounded wait is an exercise (GUIDE §7.1) and needs Kubernetes' long terminationGracePeriodSeconds (gw-09).
  • Density not measured here. The 60k→200k journey is a profiling exercise (GUIDE §7.5).