Skip to content

Fix QueueSourceSpec flaky tests with proper stream cleanup#8029

Merged
Aaronontheweb merged 2 commits into
akkadotnet:devfrom
Aaronontheweb:fix/queue-source-spec-cleanup
Jan 25, 2026
Merged

Fix QueueSourceSpec flaky tests with proper stream cleanup#8029
Aaronontheweb merged 2 commits into
akkadotnet:devfrom
Aaronontheweb:fix/queue-source-spec-cleanup

Conversation

@Aaronontheweb
Copy link
Copy Markdown
Member

Summary

Changes

Fixed tests:

  • QueueSource_should_emit_received_message_to_the_stream
  • QueueSource_should_reject_elements_when_backpressuring_with_maxBuffer_0
  • QueueSource_should_buffer_when_needed

Root Cause

The failure "Failed to stop [QueueSourceSpec-920] within [00:00:05]. ActorSystem is being forcefully shut down" occurred because stream stages weren't properly stopped when tests ended with just sub.Cancel() without waiting for cleanup. Most other tests in this file already use AssertAllStagesStoppedAsync to ensure proper cleanup.

Test plan

  • All 26 QueueSourceSpec tests pass
  • Build compiles cleanly with 0 errors and 0 warnings

Wrapped three tests in AssertAllStagesStoppedAsync to ensure proper
cleanup of stream stages before tests complete:

- QueueSource_should_emit_received_message_to_the_stream
- QueueSource_should_reject_elements_when_backpressuring_with_maxBuffer_0
- QueueSource_should_buffer_when_needed (the failing test from PR akkadotnet#8023)

The failure "Failed to stop [QueueSourceSpec-920] within [00:00:05]"
occurred because stream stages weren't properly stopped when tests
ended with just sub.Cancel() without waiting for cleanup.
@Aaronontheweb Aaronontheweb enabled auto-merge (squash) January 25, 2026 21:00
@Aaronontheweb Aaronontheweb merged commit 46034d4 into akkadotnet:dev Jan 25, 2026
12 checks passed
@Aaronontheweb Aaronontheweb deleted the fix/queue-source-spec-cleanup branch January 26, 2026 00:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant