Skip to content

Commit

Permalink
Fix persistence snapshot unit test (#7356)
Browse files Browse the repository at this point in the history
  • Loading branch information
Arkatufus authored Oct 3, 2024
1 parent 6fd8701 commit 3bdb6c0
Showing 1 changed file with 5 additions and 5 deletions.
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

0 comments on commit 3bdb6c0

Please sign in to comment.