Skip to content

test: avoid pre-materialized substream in SplitWhen TCK#3003

Open
He-Pin wants to merge 1 commit into
apache:mainfrom
He-Pin:fix/jdk25-splitwhen-tck
Open

test: avoid pre-materialized substream in SplitWhen TCK#3003
He-Pin wants to merge 1 commit into
apache:mainfrom
He-Pin:fix/jdk25-splitwhen-tck

Conversation

@He-Pin
Copy link
Copy Markdown
Member

@He-Pin He-Pin commented May 28, 2026

Motivation

SplitWhenTest can time out in the reactive-streams stochastic completion check on JDK 25 when the publisher is created from a pre-materialized tail substream.

Modification

Create the TCK publisher directly from splitWhen followed by concatSubstreams, avoiding the intermediate Sink.head materialization and cancellation of the outer stream.

Result

The publisher exercises splitWhen while keeping completion tied to the returned publisher stream.

Tests

  • JDK 25 Scala 3.3.6 with nightly-style virtualized dispatcher flags: stream-tests-tck / Test / testOnly org.apache.pekko.stream.tck.SplitWhenTest
  • scalafmt --mode diff-ref=origin/main --quiet
  • scalafmt --list --mode diff-ref=origin/main
  • git diff --check

References

Refs #2994

Motivation:
SplitWhenTest can time out in the reactive-streams stochastic completion check on JDK 25 when the publisher is created from a pre-materialized tail substream.

Modification:
Create the TCK publisher directly from splitWhen followed by concatSubstreams, avoiding the intermediate Sink.head materialization and cancellation of the outer stream.

Result:
The publisher exercises splitWhen while keeping completion tied to the returned publisher stream.

Tests:
- JDK 25 Scala 3.3.6 with nightly-style virtualized dispatcher flags: stream-tests-tck / Test / testOnly org.apache.pekko.stream.tck.SplitWhenTest
- scalafmt --mode diff-ref=origin/main --quiet
- scalafmt --list --mode diff-ref=origin/main
- git diff --check

References:
Refs apache#2994
@pjfanning
Copy link
Copy Markdown
Member

With the TCK, is there a harm with keeping the old version of the test along side the new one? More tests the better.

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.

2 participants