Skip to content

Test partitioned subscription ordering, concurrency, and shutdown #606

Description

@nmummau

Problem

PartitioningFilter has no recorded line coverage in the October 5, 2026 .NET 10 coverage run. It selects a partition and routes each message through a serial handling worker, so failures here could reorder events, block unrelated work, or lose accepted messages during shutdown. You can view a test coverage report I generated here: index.html

Source: PartitioningFilter.cs.

Proposed tests

  • Send multiple events for the same stream through a configured consume pipeline. Block the first handler and verify that later events in its partition cannot overtake it.
  • Send events to distinct partitions and verify that an unblocked partition can progress while another handler is blocked.
  • Verify default stream-based partitioning and a configured custom partition key through the partition metadata received by handlers.
  • Exercise different keys that map to the same partition and verify serial processing within that partition.
  • Begin shutdown while accepted work is queued. Verify that graceful shutdown waits for that work to finish and does not process messages twice.

Acceptance criteria

  • Ordering and independent progress are asserted through actual message handling in a consume pipeline.
  • Default and custom partition keys produce the expected handler-visible partition metadata.
  • Graceful shutdown accounts for every accepted message before completing.
  • Tests use explicit coordination signals and bounded waits instead of arbitrary sleeps to establish ordering.
  • Tests do not call the hashing implementation or task extensions directly.
  • No external broker or Docker container is required.

Validation

Run the focused subscription tests and collect coverage for the partitioning path. Use controlled keys or an injected hash where needed to make partition assignment deterministic, while retaining a test of the default configuration.

Activity

  1. linear commented on Oct 6, 2026

    @linear
  2. nmummau commented on Oct 6, 2026

    @nmummau
    ContributorAuthor

    I’ve implemented this locally with regression tests. I’m waiting for a prerequisite PR 603 to merge so I can rebase and open a focused PR. I’ll link it here once it’s ready.

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

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions