Skip to content

Commit

Permalink
changed up ActorSystem names to make it easier to debug
Browse files Browse the repository at this point in the history
  • Loading branch information
Aaronontheweb committed Nov 18, 2024
1 parent 0d4a946 commit f5a437b
Showing 1 changed file with 8 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,9 @@ namespace Akka.Remote.Tests.Transport;
/// <summary>
/// Added this spec to prove the existence of https://github.com/akkadotnet/akka.net/issues/7378
/// </summary>
public class MultiTransportAddressingSpec : AkkaSpec
public class MultiTransportAddressingSpec : TestKit.Xunit2.TestKit
{
public MultiTransportAddressingSpec(ITestOutputHelper output) : base(GetConfig(Sys1Port1, Sys1Port2), output)
public MultiTransportAddressingSpec(ITestOutputHelper output) : base(GetConfig(Sys1Port1, Sys1Port2), "MultiTransportSpec", output)
{
}

Expand All @@ -30,7 +30,7 @@ public MultiTransportAddressingSpec(ITestOutputHelper output) : base(GetConfig(S
public const int Sys2Port1 = 9993;
public const int Sys2Port2 = 9994;

private static Config GetConfig(int transportPort1, int transportPort2)
private static Config GetConfig(int transportPort1, int transportPort2, string actorSystemName = "MultiTransportSpec")
{
return $$"""

Expand All @@ -45,15 +45,15 @@ private static Config GetConfig(int transportPort1, int transportPort2)
transport-class = "Akka.Remote.Transport.TestTransport, Akka.Remote"
applied-adapters = []
registry-key = aX33k0jWKg
local-address = "test1://MultiTransportSpec@localhost:{{transportPort1}}"
local-address = "test1://{{actorSystemName}}@localhost:{{transportPort1}}"
maximum-payload-bytes = 32000b
scheme-identifier = test1
}
test2 {
transport-class = "Akka.Remote.Transport.TestTransport, Akka.Remote"
applied-adapters = []
registry-key = aX33k0j11c
local-address = "test2://MultiTransportSpec@localhost:{{transportPort2}}"
local-address = "test2://{{actorSystemName}}@localhost:{{transportPort2}}"
maximum-payload-bytes = 32000b
scheme-identifier = test2
}
Expand All @@ -67,7 +67,8 @@ private static Config GetConfig(int transportPort1, int transportPort2)
[Fact]
public async Task Should_Use_Second_Transport_For_Communication()
{
var secondSystem = ActorSystem.Create("MultiTransportSpec", GetConfig(Sys2Port1, Sys2Port2).WithFallback(Sys.Settings.Config));
const string secondActorSystemName = "MultiTransportSpec2";
var secondSystem = ActorSystem.Create(secondActorSystemName, GetConfig(Sys2Port1, Sys2Port2, secondActorSystemName).WithFallback(Sys.Settings.Config));
InitializeLogger(secondSystem);
var assertProbe = CreateTestProbe(secondSystem);

Expand All @@ -91,7 +92,7 @@ public async Task Should_Use_Second_Transport_For_Communication()

async Task PingAndVerify(string scheme, int port)
{
var selection = Sys.ActorSelection($"akka.{scheme}://MultiTransportSpec@localhost:{port}/user/echo");
var selection = Sys.ActorSelection($"akka.{scheme}://{secondActorSystemName}@localhost:{port}/user/echo");

// important: https://github.com/akkadotnet/akka.net/issues/7378 only occurs with IActorRefs
var actor = await selection.ResolveOne(TimeSpan.FromSeconds(1));
Expand Down

0 comments on commit f5a437b

Please sign in to comment.