Skip to content

test(relay): stabilize admission diagnostics under delayed lifecycle callbacks #292

Closed

Description

@abruption

Problem

After PR #291 merged, main CI 37892897777 failed in optional relay (macos-latest, python 3.13) and consequently in the release gate. ReceiverAdmission.test_saturation_counters_and_diagnostics_are_bounded_and_sanitized expected one warning but captured two.

The test starts a background Relay listener in setup. Server waitingRooms == 1 is not a barrier for completion of the client's websocket_open callback. Admission and unrelated lifecycle events use the same logger. The test enables diagnostics before joining that listener, so a delayed lifecycle callback can enter its warning-count assertion.

A local controlled scheduling reproduction delays a real owned WebSocket handshake callback until the test's asynchronous close. The unchanged test fails with 2 != 1; captured event kinds are receiver_admission and websocket_open. This proves a matching contamination path, not the identity of the original CI's second record, which the failure output does not include.

Proposed correction

  • Cancel and join the background listener, with a bounded timeout, before this counter/log arithmetic test enables diagnostics.
  • Retain the exact one-warning assertion, counter totals, sanitized event schema, absence of secret text, minute-boundary assertions and empty-resource checks.
  • Add a deterministic delayed-observer regression that fails without the cancellation/join barrier.
  • Leave product logging, admission limits, runtime version, packaging, operations and publication unchanged.

Acceptance

  • Original controlled reproduction fails before correction and succeeds afterward.
  • Delayed-observer regression also fails without the barrier; cancellation alone is insufficient.
  • Focused repeated tests, the Relay suite and the current-head CI/release gate pass without weakening assertions or suppressing logging.
  • No live agent messages, production changes or release publication.

Related: #291. This is a pre-publication v1.1.0 test-stability correction.

Activity

  1. added this to the v1.1.0 milestone on Oct 9, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions