Fix E2E test gaps and add comprehensive E2E + parity test suites
- Fix pull consumer fetch: send original stream subject in HMSG (not inbox) so NATS client distinguishes data messages from control messages - Fix MaxAge expiry: add background timer in StreamManager for periodic pruning - Fix JetStream wire format: Go-compatible anonymous objects with string enums, proper offset-based pagination for stream/consumer list APIs - Add 42 E2E black-box tests (core messaging, auth, TLS, accounts, JetStream) - Add ~1000 parity tests across all subsystems (gaps closure) - Update gap inventory docs to reflect implementation status
This commit is contained in:
@@ -0,0 +1,63 @@
|
||||
using NATS.Server.Raft;
|
||||
|
||||
namespace NATS.Server.Tests.Raft;
|
||||
|
||||
public class RaftConfigAndStateParityBatch1Tests
|
||||
{
|
||||
[Fact]
|
||||
public void RaftState_string_matches_go_labels()
|
||||
{
|
||||
RaftState.Follower.String().ShouldBe("Follower");
|
||||
RaftState.Leader.String().ShouldBe("Leader");
|
||||
RaftState.Candidate.String().ShouldBe("Candidate");
|
||||
RaftState.Closed.String().ShouldBe("Closed");
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void RaftConfig_exposes_go_shape_fields()
|
||||
{
|
||||
var cfg = new RaftConfig
|
||||
{
|
||||
Name = "META",
|
||||
Store = new object(),
|
||||
Log = new object(),
|
||||
Track = true,
|
||||
Observer = true,
|
||||
Recovering = true,
|
||||
ScaleUp = true,
|
||||
};
|
||||
|
||||
cfg.Name.ShouldBe("META");
|
||||
cfg.Store.ShouldNotBeNull();
|
||||
cfg.Log.ShouldNotBeNull();
|
||||
cfg.Track.ShouldBeTrue();
|
||||
cfg.Observer.ShouldBeTrue();
|
||||
cfg.Recovering.ShouldBeTrue();
|
||||
cfg.ScaleUp.ShouldBeTrue();
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void RaftNode_group_defaults_to_id_when_not_supplied()
|
||||
{
|
||||
using var node = new RaftNode("N1");
|
||||
node.GroupName.ShouldBe("N1");
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void RaftNode_group_uses_explicit_value_when_supplied()
|
||||
{
|
||||
using var node = new RaftNode("N1", group: "G1");
|
||||
node.GroupName.ShouldBe("G1");
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void RaftNode_created_utc_is_set_on_construction()
|
||||
{
|
||||
var before = DateTime.UtcNow;
|
||||
using var node = new RaftNode("N1");
|
||||
var after = DateTime.UtcNow;
|
||||
|
||||
node.CreatedUtc.ShouldBeGreaterThanOrEqualTo(before);
|
||||
node.CreatedUtc.ShouldBeLessThanOrEqualTo(after);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user