fix: support virtualized dispatcher test assumptions#2912
Open
He-Pin wants to merge 1 commit intoapache:mainfrom
Open
fix: support virtualized dispatcher test assumptions#2912He-Pin wants to merge 1 commit intoapache:mainfrom
He-Pin wants to merge 1 commit intoapache:mainfrom
Conversation
Motivation: Nightly builds can enable virtualized fork-join dispatchers on newer JDKs. That legitimately changes observable dispatcher thread names and disables Dispatcher batching, so tests that asserted numeric worker suffixes or default-dispatcher batching failed. Modification: - Accept both platform-thread and virtual-thread dispatcher name suffixes in thread-name assertions. - Keep production virtual-thread naming unchanged. - Run ExecutionContext batching checks on a dedicated non-virtualized dispatcher. Result: Nightly can virtualize the default and internal dispatchers while the affected tests still validate their intended behavior on JDK 17, JDK 21, and JDK 25. Tests: - JDK 25: sbt -Dpekko.test.timefactor=4 -Dpekko.actor.testkit.typed.timefactor=4 -Dpekko.actor.default-dispatcher.fork-join-executor.minimum-runnable=8 -Dpekko.actor.internal-dispatcher.fork-join-executor.minimum-runnable=8 -Dpekko.actor.default-dispatcher.fork-join-executor.virtualize=on -Dpekko.actor.internal-dispatcher.fork-join-executor.virtualize=on "slf4j / Test / testOnly org.apache.pekko.event.slf4j.Slf4jLoggerSpec" "actor-tests / Test / testOnly org.apache.pekko.actor.dispatch.DispatchersSpec org.apache.pekko.dispatch.ExecutionContextSpec" - JDK 21: sbt -Dpekko.test.timefactor=2 -Dpekko.actor.testkit.typed.timefactor=2 -Dpekko.actor.default-dispatcher.fork-join-executor.minimum-runnable=4 -Dpekko.actor.internal-dispatcher.fork-join-executor.minimum-runnable=4 -Dpekko.actor.default-dispatcher.fork-join-executor.virtualize=on -Dpekko.actor.internal-dispatcher.fork-join-executor.virtualize=on "slf4j / Test / testOnly org.apache.pekko.event.slf4j.Slf4jLoggerSpec" "actor-tests / Test / testOnly org.apache.pekko.actor.dispatch.DispatchersSpec org.apache.pekko.dispatch.ExecutionContextSpec" - JDK 21 / Scala 3.3.x: sbt -Dpekko.test.timefactor=2 -Dpekko.actor.testkit.typed.timefactor=2 -Dpekko.actor.default-dispatcher.fork-join-executor.minimum-runnable=4 -Dpekko.actor.internal-dispatcher.fork-join-executor.minimum-runnable=4 -Dpekko.actor.default-dispatcher.fork-join-executor.virtualize=on -Dpekko.actor.internal-dispatcher.fork-join-executor.virtualize=on "++ 3.3.x" "slf4j / Test / testOnly org.apache.pekko.event.slf4j.Slf4jLoggerSpec" "actor-tests / Test / testOnly org.apache.pekko.actor.dispatch.DispatchersSpec org.apache.pekko.dispatch.ExecutionContextSpec" - JDK 17: sbt -Dpekko.test.timefactor=2 -Dpekko.actor.testkit.typed.timefactor=2 "slf4j / Test / testOnly org.apache.pekko.event.slf4j.Slf4jLoggerSpec" "actor-tests / Test / testOnly org.apache.pekko.actor.dispatch.DispatchersSpec org.apache.pekko.dispatch.ExecutionContextSpec" - sbt "slf4j / Test / scalafmt" "actor-tests / Test / scalafmtCheck" "slf4j / Test / scalafmtCheck" - git diff --check References: - apache#2907 - https://github.com/apache/pekko/actions/runs/24933645620
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:
Nightly builds can enable virtualized fork-join dispatchers on newer JDKs. That legitimately changes observable dispatcher thread names and disables Dispatcher batching, so tests that asserted numeric worker suffixes or default-dispatcher batching failed.
Modification:
Result:
Nightly can virtualize the default and internal dispatchers while the affected tests still validate their intended behavior on JDK 17, JDK 21, and JDK 25.
Tests:
References: