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.
20 lines
522 B
C#
20 lines
522 B
C#
using NATS.Server.Raft;
|
|
|
|
namespace NATS.Server.Raft.Tests;
|
|
|
|
public class RaftReplicationTests
|
|
{
|
|
[Fact]
|
|
public async Task Leader_replicates_entry_to_quorum_and_applies()
|
|
{
|
|
var cluster = RaftTestCluster.Create(3);
|
|
var leader = await cluster.ElectLeaderAsync();
|
|
|
|
var idx = await leader.ProposeAsync("create-stream", default);
|
|
idx.ShouldBeGreaterThan(0);
|
|
|
|
await cluster.WaitForAppliedAsync(idx);
|
|
cluster.Nodes.All(n => n.AppliedIndex >= idx).ShouldBeTrue();
|
|
}
|
|
}
|