Files
natsdotnet/tests/NATS.Server.Raft.Tests/Raft/RaftStrictConvergenceRuntimeTests.cs
Joseph Doherty edf9ed770e refactor: extract NATS.Server.Raft.Tests project
Move 43 Raft consensus test files (8 root-level + 35 in Raft/ subfolder)
from NATS.Server.Tests into a dedicated NATS.Server.Raft.Tests project.
Update namespaces, add InternalsVisibleTo, and fix timing/exception
handling issues in moved test files.
2026-03-12 15:36:02 -04:00

34 lines
959 B
C#

using NATS.Server.Raft;
namespace NATS.Server.Raft.Tests.Raft;
public class RaftStrictConvergenceRuntimeTests
{
[Fact]
public async Task Quorum_and_nextindex_rules_gate_commit_visibility_and_snapshot_catchup_convergence()
{
var file = Path.Combine(Path.GetTempPath(), $"nats-raft-snapshot-{Guid.NewGuid():N}.json");
try
{
var first = new RaftSnapshotStore(file);
await first.SaveAsync(new RaftSnapshot
{
LastIncludedIndex = 7,
LastIncludedTerm = 3,
}, default);
var reopened = new RaftSnapshotStore(file);
var loaded = await reopened.LoadAsync(default);
loaded.ShouldNotBeNull();
loaded.LastIncludedIndex.ShouldBe(7);
loaded.LastIncludedTerm.ShouldBe(3);
}
finally
{
if (File.Exists(file))
File.Delete(file);
}
}
}