Skip to content

test: clean up TLS edge streams after early cancellation - #3000

Merged
He-Pin merged 1 commit into
apache:mainfrom
He-Pin:fix/tls-edge-cleanup-after-early-cancel
May 28, 2026
Merged

test: clean up TLS edge streams after early cancellation#3000
He-Pin merged 1 commit into
apache:mainfrom
He-Pin:fix/tls-edge-cleanup-after-early-cancel

Conversation

@He-Pin

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

Copy link
Copy Markdown
Member

Motivation

JDK 25 nightly builds time out in repeated TlsGraphStageEdgeCasesSpec early-cancellation scenarios because earlier materializations can keep draining after the expected bytes have been collected.

Modification

Materialize collectExactly with a KillSwitch and watch stream termination, then shut down and await the stream in finally after the expected bytes are collected.

Result

Repeated TLS edge-case checks do not leave prior materializations running in the same actor system.

Tests

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

References

Refs #2994

Motivation:
JDK 25 nightly builds time out in repeated TlsGraphStageEdgeCasesSpec early-cancellation scenarios because earlier materializations can keep draining after the expected bytes have been collected.

Modification:
Materialize collectExactly with a KillSwitch and watch stream termination, then shut down and await the stream in finally after the expected bytes are collected.

Result:
Repeated TLS edge-case checks do not leave prior materializations running in the same actor system.

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

References:
Refs apache#2994

@pjfanning pjfanning left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

@He-Pin
He-Pin merged commit fcc541a into apache:main May 28, 2026
9 checks passed
@He-Pin
He-Pin deleted the fix/tls-edge-cleanup-after-early-cancel branch May 28, 2026 11:16
132982jianan pushed a commit to 132982jianan/pekko that referenced this pull request Aug 2, 2026
动机:
JDK 25 每晚构建在重复的 TlsGraphStageEdgeCasesSpec 提前取消场景中会超时,因为在收集到预期字节后,早期的实现可能会继续耗尽。

修改:
使用 KillSwitch 实现collectExactly 并观察流终止,然后在收集到预期字节后关闭并等待流。

结果:
重复的 TLS 边缘情况检查不会使先前的具体化在同一参与者系统中运行。

测试:
- JDK 25 nightly-style虚拟化流调度程序标志:stream-tests / Test / testOnly org.apache.pekko.stream.io.TlsGraphStageEdgeCasesSpec
- scalafmt --mode diff-ref=origin/main --quiet
- scalafmt --list --mode diff-ref=origin/main
- git diff --检查

参考文献:
参考号apache#2994
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