You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pekko.apache.org by he...@apache.org on 2026/05/29 15:02:12 UTC
(pekko) 01/01: test: widen HandshakeRetrySpec buffered-message timeout
This is an automated email from the ASF dual-hosted git repository.
He-Pin pushed a commit to branch fix/handshake-retry-spec-timeout
in repository https://gitbox.apache.org/repos/asf/pekko.git
commit fd77b775976aa640171de5c3ff952a7dba8461d3
Author: He-Pin <he...@gmail.com>
AuthorDate: Fri May 29 23:01:25 2026 +0800
test: widen HandshakeRetrySpec buffered-message timeout
Motivation:
HandshakeRetrySpec "be retried during handshake-timeout (no message loss)"
is intermittently flaky in CI, timing out at expectMsg while waiting for
"hello" (issues #560, #634, #276). The first message is sent before systemB
exists, so it is buffered while the outbound handshake is retried, and is
only delivered once the handshake completes. With handshake-timeout = 10s,
delivery can legitimately take longer than the default expect timeout
(single-expect-default, ~6s under timefactor 2 in CI), so the assertion
fires before the message arrives even though no message is actually lost.
Modification:
Wait for the buffered "hello" with an explicit 15s timeout (dilated by
pekko.test.timefactor), comfortably above the 10s handshake-timeout.
Result:
The test no longer races the handshake window under CI load; it still
passes locally.
References:
Fixes #560
Fixes #634
Fixes #276
---
.../scala/org/apache/pekko/remote/artery/HandshakeRetrySpec.scala | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/remote/src/test/scala/org/apache/pekko/remote/artery/HandshakeRetrySpec.scala b/remote/src/test/scala/org/apache/pekko/remote/artery/HandshakeRetrySpec.scala
index cbce270c20..2c327445b7 100644
--- a/remote/src/test/scala/org/apache/pekko/remote/artery/HandshakeRetrySpec.scala
+++ b/remote/src/test/scala/org/apache/pekko/remote/artery/HandshakeRetrySpec.scala
@@ -45,7 +45,10 @@ class HandshakeRetrySpec extends ArteryMultiNodeSpec(HandshakeRetrySpec.commonCo
newRemoteSystem(name = Some("systemB"), extraConfig = Some(s"pekko.remote.artery.canonical.port = $portB"))
systemB.actorOf(TestActors.echoActorProps, "echo")
- expectMsg("hello")
+ // The first message is buffered while the outbound handshake is retried and is only
+ // delivered once the handshake completes, which can take up to handshake-timeout (10s).
+ // The default expect timeout is too tight under CI load, so wait well beyond it.
+ expectMsg(15.seconds, "hello")
sel ! Identify(None)
val remoteRef = expectMsgType[ActorIdentity].ref.get
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@pekko.apache.org
For additional commands, e-mail: commits-help@pekko.apache.org