Skip to content

Fix stream IO dispatcher test failures#2806

Merged
He-Pin merged 1 commit intoapache:mainfrom
He-Pin:port-stream-io-dispatcher-test
Mar 28, 2026
Merged

Fix stream IO dispatcher test failures#2806
He-Pin merged 1 commit intoapache:mainfrom
He-Pin:port-stream-io-dispatcher-test

Conversation

@He-Pin
Copy link
Copy Markdown
Member

@He-Pin He-Pin commented Mar 28, 2026

Motivation

Stream IO tests could fail when the default dispatcher was overloaded, because they did not explicitly specify the blocking IO dispatcher.

Modification

Updated tests to explicitly use the blocking IO dispatcher for file operations, matching production best practices.

Result

Stream IO tests are reliable regardless of default dispatcher load.

References

  • Upstream commit: akka/akka-core@145319d86d, which is now Apache licensed.
  • Cherry-picked from akka/akka-core v2.8.0 (released March 2023, BSL -> Apache 2.0 after 3 years).

@He-Pin He-Pin added this to the 2.0.0-M2 milestone Mar 28, 2026
@He-Pin He-Pin marked this pull request as ready for review March 28, 2026 07:14
@pjfanning
Copy link
Copy Markdown
Member

This text is wrong.

Cherry-picked from akka/akka-core v2.8.0 (released Sept 2022, BSL -> Apache 2.0 after 3 years).

This is in all the new PRs. Akka 2.0.0 was released in March 2023.

@He-Pin
Copy link
Copy Markdown
Member Author

He-Pin commented Mar 28, 2026

Thanks @pjfanning! You're absolutely right — v2.8.0 was released in March 2023, not September 2022 (that was v2.7.0). I've corrected this in #2802, #2803, #2805, #2806, and #2808. Apologies for the confusion!

Avoid creating custom materializers in tests that verify dispatcher
assignment. Custom materializers are not covered by StreamSpec's
afterEach cleanup, causing test pollution and failures.

Changes:
- Remove custom ActorMaterializer creation in FileSinkSpec,
  FileSourceSpec, and UnfoldResourceAsyncSourceSpec
- Use SystemMaterializer(system).materializer to access the system
  materializer supervisor for dispatcher assertions
- Remove separate ActorSystem creation in FileSourceSpec dispatcher
  tests (no longer needed with system materializer)
- Clean up StreamSpec debug dump: replace non-functional stream
  supervisor query with printDebugDump helper, add stopAllChildren
  on failure for cleanup

Upstream: akka/akka-core@145319d86d
Cherry-picked from akka/akka-core v2.8.0, which is now Apache licensed.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@He-Pin He-Pin force-pushed the port-stream-io-dispatcher-test branch from de15fb7 to cac0f9a Compare March 28, 2026 09:11
@He-Pin He-Pin requested review from mdedetrich and pjfanning March 28, 2026 09:50
Copy link
Copy Markdown
Member

@pjfanning pjfanning left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

@He-Pin He-Pin merged commit 5addd96 into apache:main Mar 28, 2026
9 checks passed
@He-Pin He-Pin deleted the port-stream-io-dispatcher-test branch March 28, 2026 11:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants