Skip to content

Fix direct-send allocation test failure on main #115

Closed

Description

@thomhurst

The latest push CI on main failed in Build & Test / Test on dbb4bca:
https://github.com/thomhurst/Relayer/actions/runs/41318498696

SenderTests.Direct_send_has_zero_steady_state_allocations_with_the_default_serializer(False) expected 0 allocated bytes but measured 280 at tests/Relayer.Tests/SenderTests.cs:337. The Release build passed; 583 other tests passed. This is the first attempt, and no infrastructure error appears in the failed log.

Reproduce with dotnet test -c Release on the commit, or focus the SenderTests allocation case using the TUnit tree filter. Investigate whether the bytes come from the send pipeline or measurement/runtime setup; do not weaken the zero-allocation contract or rerun CI merely for green.

Acceptance criteria:

  • Identify and fix the cause of the unexpected measured allocation.
  • Preserve an exact zero-byte steady-state assertion for direct sends with both scalar-key options.
  • Validate the focused cases and the Release suite; record environment limits if Linux-only reproduction requires hosted CI.

Activity

  1. added
    bugSomething isn't working
    P1High priority
    on Nov 1, 2026
  2. thomhurst commented on Nov 1, 2026

    @thomhurst
    OwnerAuthor

    The old prerequisite is cleared: #111 merged and run 41316941844 succeeded. Main run 41318498696 is a separate intermittent allocation failure, not an infrastructure failure.

    Linux diagnostics reproduced 280 B in both timer arming and timer cleanup, outside serialization and dispatch. A separate BCL-only probe that deliberately contends a CancellationTokenSource timer-queue lock also allocates runtime wait state (56 B in that controlled case). The runtime's TimerQueueTimer.Change uses a shared TimerQueue lock, whose first contended wait lazily creates an AutoResetEvent. The batch allocation comparison also reproduced a 280 B excess under concurrent suite execution.

    The fix isolates the three send/timer-backed allocation tests with unkeyed TUnit NotInParallel. It keeps all warmup loops and exact zero-byte/baseline assertions, changes no production code, and leaves other tests parallel. Validation is in progress on Windows and Linux. Main has since passed run 41319039245, which confirms intermittency rather than resolving the measurement race.

  3. added
    area: testingTest harness, in-memory transport, conformance
    phase-0: coreCore abstractions, pipeline, generator, testing
    on Nov 1, 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

    P1High priorityarea: testingTest harness, in-memory transport, conformancebugSomething isn't workingin-progressClaimed by an agentphase-0: coreCore abstractions, pipeline, generator, testing

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions