Skip to content
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

Fix persistence snapshot unit test #7356

Merged
merged 1 commit into from
Oct 3, 2024
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
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ protected SnapshotStoreSaveSnapshotSpec(Config config = null, string actorSystem
}

[Fact(DisplayName = "Rapid multiple SaveSnapshot invocation with no journal persist should only save the latest snapshot")]
public async Task MultipleSnapshotsWithNoPersistTest()
public virtual async Task MultipleSnapshotsWithNoPersistTest()
{
if(!SupportsConcurrentSaves)
return;
Expand Down Expand Up @@ -97,7 +97,7 @@ public async Task MultipleSnapshotsWithNoPersistTest()
}

[Fact(DisplayName = "Rapid multiple SaveSnapshot invocation with journal persist should only save the latest snapshot")]
public async Task MultipleSnapshotsWithPersistTest()
public virtual async Task MultipleSnapshotsWithPersistTest()
{
if(!SupportsConcurrentSaves)
return;
Expand Down Expand Up @@ -132,20 +132,20 @@ public async Task MultipleSnapshotsWithPersistTest()
}

[Fact(DisplayName = "Multiple SaveSnapshot invocation with the same sequence number should not throw")]
public async Task MultipleSnapshotsWithSameSeqNo()
public virtual async Task MultipleSnapshotsWithSameSeqNo()
{
var persistence = Persistence.Instance.Apply(Sys);
var snapshotStore = persistence.SnapshotStoreFor(null);
var snap = new TestPayload(SenderProbe.Ref);

var metadata = new SnapshotMetadata(PersistenceId, 3, DateTime.Now);
var metadata = new SnapshotMetadata(PersistenceId, 3, DateTime.UtcNow);
snapshotStore.Tell(new SaveSnapshot(metadata, snap), SenderProbe);
var success = await SenderProbe.ExpectMsgAsync<SaveSnapshotSuccess>(10.Minutes());
success.Metadata.PersistenceId.Should().Be(metadata.PersistenceId);
success.Metadata.Timestamp.Should().Be(metadata.Timestamp);
success.Metadata.SequenceNr.Should().Be(metadata.SequenceNr);

metadata = new SnapshotMetadata(PersistenceId, 3, DateTime.Now);
metadata = new SnapshotMetadata(PersistenceId, 3, DateTime.UtcNow);
snapshotStore.Tell(new SaveSnapshot(metadata, 3), SenderProbe);
success = await SenderProbe.ExpectMsgAsync<SaveSnapshotSuccess>();
success.Metadata.PersistenceId.Should().Be(metadata.PersistenceId);
Expand Down
Loading