This is an automated email from the ASF dual-hosted git repository.

He-Pin pushed a commit to branch 1.7.x
in repository https://gitbox.apache.org/repos/asf/pekko.git


The following commit(s) were added to refs/heads/1.7.x by this push:
     new cc5e2e84cc test: align ForkJoinExecutorConfiguratorSpec with 1.x 
minimum-runnable default (#3577)
cc5e2e84cc is described below

commit cc5e2e84ccb5d1e12443efd48bd3dbf774335c11
Author: PJ Fanning <[email protected]>
AuthorDate: Fri Oct 9 06:45:04 2026 +0100

    test: align ForkJoinExecutorConfiguratorSpec with 1.x minimum-runnable 
default (#3577)
    
    Motivation:
    On 1.7.x, reference.conf keeps minimum-runnable = 1 for backward
    compatibility, but the spec was backported from main where the default
    is -1. On JDK 25 the 'auto-scale the default' test saw 1 and failed.
    
    Modification:
    Assert the untouched default resolves to 1 on all JDKs, and exercise the
    JDK-aware policy via dispatchers that opt in with minimum-runnable = -1.
    Fix the reference.conf comment that still called -1 the default.
    
    Result:
    The spec matches the 1.x default and passes on JDK 25.
    
    Tests:
    - Not run locally; relying on CI (JDK 25 job)
    
    References:
    Refs #3037
---
 .../ForkJoinExecutorConfiguratorSpec.scala         | 24 ++++++++++++++++++----
 actor/src/main/resources/reference.conf            |  2 +-
 2 files changed, 21 insertions(+), 5 deletions(-)

diff --git 
a/actor-tests/src/test/scala/org/apache/pekko/dispatch/ForkJoinExecutorConfiguratorSpec.scala
 
b/actor-tests/src/test/scala/org/apache/pekko/dispatch/ForkJoinExecutorConfiguratorSpec.scala
index 5bf7c12255..28aad29f6e 100644
--- 
a/actor-tests/src/test/scala/org/apache/pekko/dispatch/ForkJoinExecutorConfiguratorSpec.scala
+++ 
b/actor-tests/src/test/scala/org/apache/pekko/dispatch/ForkJoinExecutorConfiguratorSpec.scala
@@ -38,12 +38,22 @@ object ForkJoinExecutorConfiguratorSpec {
       |    parallelism-max = 64
       |  }
       |}
+      |fj-auto-opt-in-dispatcher {
+      |  executor = "fork-join-executor"
+      |  fork-join-executor {
+      |    parallelism-min = 8
+      |    parallelism-factor = 1.0
+      |    parallelism-max = 64
+      |    minimum-runnable = -1
+      |  }
+      |}
       |fj-auto-small-dispatcher {
       |  executor = "fork-join-executor"
       |  fork-join-executor {
       |    parallelism-min = 1
       |    parallelism-factor = 1.0
       |    parallelism-max = 1
+      |    minimum-runnable = -1
       |  }
       |}
       |fj-explicit-zero-dispatcher {
@@ -150,10 +160,16 @@ class ForkJoinExecutorConfiguratorSpec extends 
PekkoSpec(ForkJoinExecutorConfigu
       resolvedMinimumRunnable("fj-explicit-seven-dispatcher") shouldBe 7
     }
 
-    "auto-scale the default (minimum-runnable not set) on JDK 25+" in {
+    "keep the legacy value of 1 on all JDKs when the default is left 
untouched" in {
+      // In Pekko 1.x, reference.conf sets minimum-runnable = 1 for backward 
compatibility,
+      // so the JDK-aware auto policy only applies when users opt in with -1.
+      resolvedMinimumRunnable("fj-auto-default-dispatcher") shouldBe 1
+    }
+
+    "auto-scale when minimum-runnable = -1 on JDK 25+" in {
       if (JavaVersion.majorVersion < 25) pending
 
-      val resolved = resolvedMinimumRunnable("fj-auto-default-dispatcher")
+      val resolved = resolvedMinimumRunnable("fj-auto-opt-in-dispatcher")
       // The dispatcher declares parallelism-min = 8 so effective parallelism 
is at
       // least 8; auto = min(8, max(1, parallelism/2)) must be at least 4 and 
never
       // exceed the documented cap of 8.
@@ -161,10 +177,10 @@ class ForkJoinExecutorConfiguratorSpec extends 
PekkoSpec(ForkJoinExecutorConfigu
       resolved should be <= 8
     }
 
-    "keep the legacy value of 1 on JDK < 25 when the default is left 
untouched" in {
+    "keep the legacy value of 1 on JDK < 25 when minimum-runnable = -1" in {
       if (JavaVersion.majorVersion >= 25) pending
 
-      resolvedMinimumRunnable("fj-auto-default-dispatcher") shouldBe 1
+      resolvedMinimumRunnable("fj-auto-opt-in-dispatcher") shouldBe 1
     }
 
     "never drop below 1 even for parallelism = 1 dispatchers" in {
diff --git a/actor/src/main/resources/reference.conf 
b/actor/src/main/resources/reference.conf
index f6af1ad7f4..304646568f 100644
--- a/actor/src/main/resources/reference.conf
+++ b/actor/src/main/resources/reference.conf
@@ -494,7 +494,7 @@ pekko {
         # In Pekko 1.x, the default value is 1 for backward compatibility, but 
this is not ideal
         # on newer JDKs.
         #
-        # The special value -1 (default) selects a JDK-aware policy:
+        # The special value -1 selects a JDK-aware policy:
         #   * JDK 25+ : effective value = min(8, max(1, parallelism / 2))
         #   * JDK < 25: effective value = 1 (preserves the JDK behaviour prior 
to this setting)
         # Auto-selection on JDK 25+ mitigates the asyncMode (FIFO) 
compensation-thread regression


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to