try to fix flaky RotatingProviderWithChangingKeysSpec#2940
Merged
pjfanning merged 2 commits intoapache:mainfrom May 7, 2026
Merged
try to fix flaky RotatingProviderWithChangingKeysSpec#2940pjfanning merged 2 commits intoapache:mainfrom
pjfanning merged 2 commits intoapache:mainfrom
Conversation
…e contact robustness Motivation: The `must rebuild the SSLContext using new keys` test is flaky because `contact` times out (6s) while TLS connection establishment is still in progress. A single failed run discards all the work done in that attempt. Modification: - `contact` now retries the `Identify`/`ActorIdentity` exchange up to 3 times (3 s each) rather than failing immediately on one timeout, giving TLS connection establishment additional time to complete. - `RotatingProviderWithChangingKeysSpec` overrides `withFixture` to retry the whole test once on failure. Before retrying, actor systems created during the failed attempt are terminated so they do not interfere with the second run (no port conflicts since new systems obtain fresh dynamic ports; systems are also tracked in ArteryMultiNodeSpec.remoteSystems for final cleanup in afterTermination). - Added `import scala.concurrent.duration._` required by `3.seconds`. Result: The test is more resilient to transient TLS handshake delays and is automatically retried once if it still fails. Tests: - scalafmt not installed; sbt not installed; recorded as skipped - sbt "remote / Test / testOnly o.a.p.remote.artery.tcp.ssl.RotatingProviderWithChangingKeysSpec" - skipped (sbt unavailable) References: None - reduces test flakiness Agent-Logs-Url: https://github.com/pjfanning/incubator-pekko/sessions/080d49a3-0c3c-401b-ae0a-a5fe875189cc Co-authored-by: pjfanning <11783444+pjfanning@users.noreply.github.com>
He-Pin
approved these changes
May 7, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
retry test and improve contact robustness
failed latest night on Java 21 - https://github.com/apache/pekko/actions/runs/25410349422/job/74530492150
Motivation:
The
must rebuild the SSLContext using new keystest is flaky becausecontacttimes out (6s) while TLS connection establishment is still in progress. A single failed run discards all the work done in that attempt.Modification:
contactnow retries theIdentify/ActorIdentityexchange up to 3 times (3 s each) rather than failing immediately on one timeout, giving TLS connection establishment additional time to complete.RotatingProviderWithChangingKeysSpecoverrideswithFixtureto retry the whole test once on failure. Before retrying, actor systems created during the failed attempt are terminated so they do not interfere with the second run (no port conflicts since new systems obtain fresh dynamic ports; systems are also tracked in ArteryMultiNodeSpec.remoteSystems for final cleanup in afterTermination).import scala.concurrent.duration._required by3.seconds.Result:
The test is more resilient to transient TLS handshake delays and is automatically retried once if it still fails.
Tests:
References:
None - reduces test flakiness
Agent-Logs-Url: https://github.com/pjfanning/incubator-pekko/sessions/080d49a3-0c3c-401b-ae0a-a5fe875189cc