You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@pekko.apache.org by "He-Pin (via GitHub)" <gi...@apache.org> on 2026/04/18 15:31:33 UTC

[PR] fix: scale stream test timeouts by timefactor to fix nightly CI on JDK 25 [pekko]

He-Pin opened a new pull request, #2869:
URL: https://github.com/apache/pekko/pull/2869

   ## Summary
   
   Nightly CI has been failing for 30+ consecutive days on JDK 25 (and occasionally JDK 17/Scala 3.3.x). This PR fixes **4 root causes** identified from CI run [#24592739160](https://github.com/apache/pekko/actions/runs/24592739160).
   
   ## Root Causes & Fixes
   
   ### 1. `HubSpec` — patience timeout not scaled by timefactor
   - **Problem**: `PatienceConfig(timeout = Span(60, Seconds))` was hard-coded; with JDK 25 `TIMEFACTOR=3`, the budget needed is 180 s but only 60 s was given.
   - **Fix**: Multiply by `testKitSettings.TestTimeFactor` → 120 s on JDK 17/21 CI, 180 s on JDK 25 CI.
   
   ### 2. `AggregateWithTimeBoundaryAndSimulatedTimeSpec` — 400 000 timer firings
   - **Problem**: `interval = 1.milli` with `ExplicitlyTriggeredScheduler.timePasses(400.seconds)` fired **400 000** timer callbacks, each requiring a scheduler lock acquisition on JDK 25's revised ForkJoinPool.
   - **Fix**: Change `interval = 1.milli` → `interval = 1.second` in the gap and duration tests, reducing firings to ~400. Test semantics are unchanged.
   
   ### 3. `stream-tests-tck/Timeouts` — TCK timeouts not timefactor-aware
   - **Problem**: `defaultTimeoutMillis = 800` / `defaultNoSignalsTimeoutMillis = 200` were hard-coded, causing `stochastic_spec103_mustSignalOnMethodsSequentially` to fail on JDK 25 (needs 2400 ms / 600 ms with TIMEFACTOR=3).
   - **Fix**: Read `pekko.test.timefactor` JVM system property and scale both values.
   
   ### 4. `FlowMapAsyncPartitionedSpec` — non-deterministic null test
   - **Problem**: `shouldBeNull` was built with `Random.nextInt(10)` (produces 0–9). Since elements are 1–10, the value `0` can never match, so the set could be `{0}` meaning no element returns null — making the test a non-deterministic no-op that flaked on JDK 17/Scala 3.3.x.
   - **Fix**: Replace random generation with fixed `Set(2, 5, 8)` — values all within 1–10 range, always exercising null filtering deterministically.
   
   ## Failing Tests Fixed
   
   | Job | Failing Test |
   |-----|-------------|
   | JDK25/2.13.x | `HubSpec` — must work with long streams (×3) |
   | JDK25/2.13.x | `AggregateWithTimeBoundaryAndSimulatedTimeSpec` — split aggregator by total duration |
   | JDK25/2.13.x | TCK `stochastic_spec103_mustSignalOnMethodsSequentially` |
   | JDK25/3.3.x  | Same as above |
   | JDK17/3.3.x  | `FlowMapAsyncPartitionedSpec` — must ignore null-completed futures |
   
   ## Verification
   
   - `AggregateWithTimeBoundaryAndSimulatedTimeSpec`: all 3 tests pass ✅
   - `FlowMapAsyncPartitionedSpec` null test: passes ✅
   - `HubSpec` / TCK: fix is validated by logic — local environment too slow to confirm 60 s tests reliably, but timefactor scaling is correct and consistent with the existing pattern used throughout the test suite.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@pekko.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@pekko.apache.org
For additional commands, e-mail: notifications-help@pekko.apache.org


Re: [PR] fix: stabilise stream tests on JDK 25 nightly (timeout scaling, element counts) [pekko]

Posted by "He-Pin (via GitHub)" <gi...@apache.org>.
He-Pin merged PR #2869:
URL: https://github.com/apache/pekko/pull/2869


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@pekko.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@pekko.apache.org
For additional commands, e-mail: notifications-help@pekko.apache.org


Re: [PR] fix: scale stream test timeouts by timefactor to fix nightly CI on JDK 25 [pekko]

Posted by "pjfanning (via GitHub)" <gi...@apache.org>.
pjfanning commented on code in PR #2869:
URL: https://github.com/apache/pekko/pull/2869#discussion_r3105515701


##########
stream-tests/src/test/scala/org/apache/pekko/stream/scaladsl/AggregateWithBoundarySpec.scala:
##########
@@ -165,7 +165,7 @@ class AggregateWithTimeBoundaryAndSimulatedTimeSpec extends AnyWordSpecLike with
         maxGap = Some(maxGap), // elements with longer gap will put put to next aggregator
         maxDuration = None,
         currentTimeMs = schedulerTimeMs,
-        interval = 1.milli)
+        interval = 1.second)

Review Comment:
   I would prefer if this was a bit smaller, eg 500 Millis or 250 Millis but main thing is to try to get the tests passing



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@pekko.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@pekko.apache.org
For additional commands, e-mail: notifications-help@pekko.apache.org