Fix stream IO dispatcher test failures#2806
Merged
He-Pin merged 1 commit intoapache:mainfrom Mar 28, 2026
Merged
Conversation
Member
|
This text is wrong. This is in all the new PRs. Akka 2.0.0 was released in March 2023. |
Member
Author
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>
de15fb7 to
cac0f9a
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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