-
Notifications
You must be signed in to change notification settings - Fork 1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Added spec to demonstrate failed snapshot-only recovery #6822
Added spec to demonstrate failed snapshot-only recovery #6822
Conversation
Tests whether a persistent actor will properly fail during a failed snapshot recovery or during a timed out one. This is all without ever having saved an event to the journal, so the `MaxSeqNo` is set to `0`.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Detailed my changes - ultimately this was more about testing a theory on behalf of a customer. No real structural changes to any Akka.NET modules.
@@ -3,7 +3,7 @@ | |||
<PropertyGroup> | |||
<AssemblyTitle>Akka.Persistence.TestKit</AssemblyTitle> | |||
<Description>TestKit for writing tests for Akka.NET Persistance module.</Description> | |||
<TargetFrameworks>$(NetStandardLibVersion)</TargetFrameworks> | |||
<TargetFrameworks>$(NetStandardLibVersion);$(NetLibVersion)</TargetFrameworks> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added dual-targeting to the Akka.Persistence.TestKit (net6
)
@@ -8,6 +8,7 @@ | |||
|
|||
<ItemGroup> | |||
<ProjectReference Include="..\..\contrib\serializers\Akka.Serialization.Hyperion\Akka.Serialization.Hyperion.csproj" /> | |||
<ProjectReference Include="..\Akka.Persistence.TestKit.Xunit2\Akka.Persistence.TestKit.Xunit2.csproj" /> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Referenced the Akka.Persistence.TestKit so I could more easily simulate journal / snapshot store failures
{ | ||
var actor2 = Sys.ActorOf(Props.Create(() => new PersistentActor("p1", probe.Ref))); | ||
Watch(actor2); | ||
await probe.ExpectNoMsgAsync(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should not receive an SnapshotSaved
here as the actor will not successfully complete recovery under either scenario.
var actor2 = Sys.ActorOf(Props.Create(() => new PersistentActor("p1", probe.Ref))); | ||
Watch(actor2); | ||
await probe.ExpectNoMsgAsync(); | ||
await ExpectTerminatedAsync(actor2); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actor should have self-terminated by now.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Changes
Tests whether a persistent actor will properly fail during a failed snapshot recovery or during a timed out one. This is all without ever having saved an event to the journal, so the
MaxSeqNo
is set to0
.Checklist
For significant changes, please ensure that the following have been completed (delete if not relevant):