Skip to content

fix: Reduce Java 25 nightly stream test flakiness#2728

Merged
pjfanning merged 1 commit intoapache:mainfrom
He-Pin:fix-java25-stream-test-flakiness
Mar 15, 2026
Merged

fix: Reduce Java 25 nightly stream test flakiness#2728
pjfanning merged 1 commit intoapache:mainfrom
He-Pin:fix-java25-stream-test-flakiness

Conversation

@He-Pin
Copy link
Member

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

Motivation

JDK 25 introduced changes to ForkJoinPool scheduling behavior that cause ~100+ stream test failures per nightly CI run. The most affected tests are high-throughput stream tests (FlowFlatMapConcatParallelismSpec, HubSpec, MapAsyncPartitionedSpec, AggregateWithBoundarySpec) that have timing-sensitive assertions.

Modification

  1. Nightly CI (.github/workflows/nightly-builds.yml): Added timefactor=3 for JDK 25+ builds, scaling all dilated timeouts across the entire test suite
  2. FlowFlatMapConcatParallelismSpec: Added explicit PatienceConfig(30.seconds) for high-element-count tests (100K elements)
  3. HubSpec: Added explicit PatienceConfig(30.seconds) for 20K+ element throughput tests
  4. MapAsyncPartitionedSpec: Increased patience from 5s to 15s (3x, matching timefactor)
  5. AggregateWithBoundarySpec: Increased Await.result timeouts from 10s to 30s (3x)

Result

  • All modified tests pass locally
  • The timefactor=3 in nightly CI provides a safety net for tests without explicit overrides
  • Explicit timeout increases target the highest-failure tests identified from nightly CI logs

References

Motivation: JDK 25 ForkJoinPool scheduling changes cause nightly CI
stream tests to fail with timeouts — ~100+ failures per night.

Modifications:
- Increase timefactor from 2 to 3 for JDK 25+ in nightly CI workflow
- Add 30s PatienceConfig to FlowFlatMapConcatParallelismSpec (100K elements)
- Add 30s PatienceConfig to HubSpec (20K element long-stream tests)
- Increase MapAsyncPartitionedSpec patience from 5s to 15s
- Increase AggregateWithBoundarySpec Await timeouts from 10s to 30s

Result: Timing-sensitive stream tests have sufficient timeout headroom
on JDK 25, reducing false failures in nightly CI.

References: apache#2573

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copy link
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.

worth a try - lgtm

@pjfanning pjfanning merged commit 9950b4a into apache:main Mar 15, 2026
9 checks passed
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.

nightly tests (CI): java 25 runs have a lot of stream test failures

2 participants