Skip to content

test: shut down cluster test systems in reverse order#2997

Merged
He-Pin merged 1 commit into
mainfrom
fix/nightly-mixed-protocol-shutdown
May 27, 2026
Merged

test: shut down cluster test systems in reverse order#2997
He-Pin merged 1 commit into
mainfrom
fix/nightly-mixed-protocol-shutdown

Conversation

@He-Pin
Copy link
Copy Markdown
Member

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

Motivation

MixedProtocolClusterSpec nightly runs can pass their cluster join assertions but still fail in shutdownAll when the first seed ActorSystem is stopped before the joining nodes have left. On JDK 25 virtualized dispatcher runs this can leave remoting shutdown waiting until the actor-system-terminate phase times out.

Modification

Shut down ClusterTestKit actor systems in reverse registration order so joining nodes leave first while the seed is still available.

Result

Multi-ActorSystem cluster specs using shutdownAll keep the seed alive until dependent nodes have terminated, reducing shutdown timeout flakiness without reducing test coverage or weakening assertions.

Tests

  • JDK 25 nightly-style: sbt "cluster / Test / testOnly org.apache.pekko.cluster.MixedProtocolClusterSpec" - 9 tests succeeded / 0 failed
  • scalafmt --mode diff-ref=origin/main
  • scalafmt --list --mode diff-ref=origin/main
  • git diff --check

References

None - nightly-builds.yml MixedProtocolClusterSpec shutdown timeout

Motivation:
MixedProtocolClusterSpec nightly runs can pass their cluster join assertions but still fail when shutdownAll stops the first seed ActorSystem before the joining nodes have left. On JDK 25 virtualized dispatcher runs this can leave remoting shutdown waiting until the actor-system-terminate phase times out.

Modification:
Shut down ClusterTestKit actor systems in reverse registration order so joining nodes leave first while the seed is still available.

Result:
Multi-ActorSystem cluster specs using shutdownAll keep the seed alive until the dependent nodes have terminated, reducing shutdown timeout flakiness without reducing test coverage.

Tests:
- JDK 25 nightly-style: sbt "cluster / Test / testOnly org.apache.pekko.cluster.MixedProtocolClusterSpec" - 9 tests succeeded / 0 failed
- scalafmt --mode diff-ref=origin/main
- scalafmt --list --mode diff-ref=origin/main
- git diff --check

References:
None - nightly-builds.yml MixedProtocolClusterSpec shutdown timeout
Copy link
Copy Markdown
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.

lgtm

@He-Pin He-Pin merged commit e482f18 into main May 27, 2026
9 checks passed
@He-Pin He-Pin deleted the fix/nightly-mixed-protocol-shutdown branch May 27, 2026 11:49
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