This is an automated email from the ASF dual-hosted git repository.
He-Pin pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/pekko.git
The following commit(s) were added to refs/heads/main by this push:
new cef8591553 test: verify ActorContext.ask compiles with multi-parameter
requests (#3645)
cef8591553 is described below
commit cef8591553b180e5810262bf70db1b6048253659
Author: PJ Fanning <[email protected]>
AuthorDate: Fri Oct 23 04:35:13 2026 +0100
test: verify ActorContext.ask compiles with multi-parameter requests (#3645)
Motivation:
`ClusterShardingSpec` has a commented-out block with a FIXME. It was meant
to check that `ActorContext.ask` compiles when the request message takes more
than one parameter. It was disabled because it did not compile with an early
Scala 2.13 milestone. The `ActorContext.ask` signature has changed since then,
but the check was never turned back on.
Modification:
Turn the block back on in the "EntityRef - ActorContext.ask" test. It now
uses the current `ctx.ask[Req, Res](target, createRequest)` signature with a
`WhoAreYou2(17, _)` request to the sharded entity ref.
Result:
The tests again check that `ActorContext.ask` accepts request factories for
messages with several parameters. The stale FIXME is gone.
Tests:
- Not run locally - left to CI
References:
Ported from (Apache-2.0 since 2026-10-23):
- https://github.com/akka/akka-core/pull/32174
Notes for reviewers:
- Test-only change, so there are no binary compatibility concerns.
- The behavior is only built inside `Behaviors.setup` and never spawned. It
is a compile-time check, as the original block intended.
---
.../pekko/cluster/sharding/typed/scaladsl/ClusterShardingSpec.scala | 6 +-----
1 file changed, 1 insertion(+), 5 deletions(-)
diff --git
a/cluster-sharding-typed/src/test/scala/org/apache/pekko/cluster/sharding/typed/scaladsl/ClusterShardingSpec.scala
b/cluster-sharding-typed/src/test/scala/org/apache/pekko/cluster/sharding/typed/scaladsl/ClusterShardingSpec.scala
index aa5eaf3497..510f61dcef 100644
---
a/cluster-sharding-typed/src/test/scala/org/apache/pekko/cluster/sharding/typed/scaladsl/ClusterShardingSpec.scala
+++
b/cluster-sharding-typed/src/test/scala/org/apache/pekko/cluster/sharding/typed/scaladsl/ClusterShardingSpec.scala
@@ -314,18 +314,14 @@ class ClusterShardingSpec
peterRef ! StopPlz()
- // FIXME #26514: doesn't compile with Scala 2.13.0-M5
- /*
// make sure request with multiple parameters compile
Behaviors.setup[TheReply] { ctx =>
- ctx.ask(aliceRef)(WhoAreYou2(17, _)) {
+ ctx.ask[WhoAreYou2, String](peterRef, WhoAreYou2(17, _)) {
case Success(name) => TheReply(name)
case Failure(ex) => TheReply(ex.getMessage)
}
-
Behaviors.empty
}
- */
}
"EntityRef - AskTimeoutException" in {
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]