Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 14 additions & 13 deletions src/core/Akka.Remote.Tests/TransientSerializationErrorSpec.cs
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ public override byte[] ToBinary(object obj)
}
}

internal class EchoActor : ActorBase
private class EchoActor : ActorBase
{
public static Props Props()
{
Expand All @@ -130,16 +130,16 @@ protected override bool Receive(object message)
}
}

private readonly ActorSystem system2;
private readonly Address system2Address;
private readonly ActorSystem _system2;
private readonly Address _system2Address;

public AbstractTransientSerializationErrorSpec(Config config)
protected AbstractTransientSerializationErrorSpec(Config config)
: base(config.WithFallback(ConfigurationFactory.ParseString(GetConfig())))
{
var port = ((ExtendedActorSystem)Sys).Provider.DefaultAddress.Port;

system2 = ActorSystem.Create(Sys.Name, Sys.Settings.Config);
system2Address = ((ExtendedActorSystem)system2).Provider.DefaultAddress;
_system2 = ActorSystem.Create(Sys.Name, Sys.Settings.Config);
_system2Address = ((ExtendedActorSystem)_system2).Provider.DefaultAddress;
}

private static string GetConfig()
Expand Down Expand Up @@ -168,21 +168,22 @@ private static string GetConfig()
";
}

protected override async Task AfterTerminationAsync()
protected override async Task AfterAllAsync()
{
await ShutdownAsync(system2);
await base.AfterAllAsync();
await ShutdownAsync(_system2);
}


[Fact]
public void The_transport_must_stay_alive_after_a_transient_exception_from_the_serializer()
public async Task The_transport_must_stay_alive_after_a_transient_exception_from_the_serializer()
{
system2.ActorOf(EchoActor.Props(), "echo");
_system2.ActorOf(EchoActor.Props(), "echo");

var selection = Sys.ActorSelection(new RootActorPath(system2Address) / "user" / "echo");
var selection = Sys.ActorSelection(new RootActorPath(_system2Address) / "user" / "echo");

selection.Tell("ping", this.TestActor);
ExpectMsg("ping");
await ExpectMsgAsync("ping");

// none of these should tear down the connection
selection.Tell(ManifestIllegal.Instance, this.TestActor);
Expand All @@ -194,7 +195,7 @@ public void The_transport_must_stay_alive_after_a_transient_exception_from_the_s

// make sure we still have a connection
selection.Tell("ping", this.TestActor);
ExpectMsg("ping");
await ExpectMsgAsync("ping");
}
}

Expand Down