test(batch38-t3): add cluster lifecycle consistency mapped tests
This commit is contained in:
@@ -188,4 +188,50 @@ public sealed class JetStreamClusterTests1
|
||||
|
||||
cluster.IsConsumerLeader("A", "S", "C1").ShouldBeTrue();
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void JetStreamClusterPeerRemovalAndServerBroughtBack_ShouldSucceed()
|
||||
{
|
||||
var cluster = new JetStreamCluster();
|
||||
var assignment = new ConsumerAssignment { Name = "C1", Stream = "S" };
|
||||
|
||||
cluster.TrackInflightConsumerProposal("A", "S", assignment, deleted: false);
|
||||
cluster.RemoveInflightConsumerProposal("A", "S", "C1");
|
||||
|
||||
cluster.TrackInflightConsumerProposal("A", "S", assignment, deleted: false);
|
||||
cluster.InflightConsumers["A"]["S"].ContainsKey("C1").ShouldBeTrue();
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void JetStreamClusterUpgradeConsumerVersioning_ShouldSucceed()
|
||||
{
|
||||
var cfg = new ConsumerConfig
|
||||
{
|
||||
Durable = "D",
|
||||
Metadata = new Dictionary<string, string> { ["legacy"] = "true" },
|
||||
PriorityPolicy = PriorityPolicy.PriorityPinnedClient,
|
||||
PriorityGroups = ["g1"],
|
||||
};
|
||||
|
||||
JetStreamVersioning.SetStaticConsumerMetadata(cfg);
|
||||
var upgraded = JetStreamVersioning.SetDynamicConsumerMetadata(cfg);
|
||||
|
||||
upgraded.Metadata.ShouldNotBeNull();
|
||||
upgraded.Metadata.ShouldContainKey(JetStreamVersioning.JsServerLevelMetadataKey);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void JetStreamClusterOfflineStreamAndConsumerUpdate_ShouldSucceed()
|
||||
{
|
||||
var updates = new RecoveryUpdates();
|
||||
var stream = new StreamAssignment { Client = new ClientInfo { Account = "A" }, Config = new StreamConfig { Name = "S" } };
|
||||
var consumer = new ConsumerAssignment { Client = new ClientInfo { Account = "A" }, Stream = "S", Name = "C" };
|
||||
|
||||
updates.AddStream(stream);
|
||||
updates.AddOrUpdateConsumer(consumer);
|
||||
|
||||
updates.AddStreams.ShouldContainKey("A:S");
|
||||
updates.UpdateConsumers.ShouldContainKey("A:S");
|
||||
updates.UpdateConsumers["A:S"].ShouldContainKey("S:C");
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user