refactor: extract NATS.Server.JetStream.Tests project
Move 225 JetStream-related test files from NATS.Server.Tests into a dedicated NATS.Server.JetStream.Tests project. This includes root-level JetStream*.cs files, storage test files (FileStore, MemStore, StreamStoreContract), and the full JetStream/ subfolder tree (Api, Cluster, Consumers, MirrorSource, Snapshots, Storage, Streams). Updated all namespaces, added InternalsVisibleTo, registered in the solution file, and added the JETSTREAM_INTEGRATION_MATRIX define.
This commit is contained in:
@@ -0,0 +1,37 @@
|
||||
using NATS.Server.JetStream.Storage;
|
||||
|
||||
namespace NATS.Server.JetStream.Tests.JetStream;
|
||||
|
||||
public class JetStreamFileStoreRecoveryStrictParityTests
|
||||
{
|
||||
[Fact]
|
||||
public async Task Filestore_recovery_preserves_sequence_subject_index_and_integrity_after_prune_and_restart_cycles()
|
||||
{
|
||||
var dir = Path.Combine(Path.GetTempPath(), $"nats-js-fs-recovery-{Guid.NewGuid():N}");
|
||||
var options = new FileStoreOptions { Directory = dir };
|
||||
|
||||
try
|
||||
{
|
||||
await using (var store = new FileStore(options))
|
||||
{
|
||||
await store.AppendAsync("orders.created", "a"u8.ToArray(), default);
|
||||
await store.AppendAsync("orders.created", "b"u8.ToArray(), default);
|
||||
await store.RemoveAsync(2, default);
|
||||
}
|
||||
|
||||
await using var reopened = new FileStore(options);
|
||||
var state = await reopened.GetStateAsync(default);
|
||||
state.Messages.ShouldBe((ulong)1);
|
||||
state.LastSeq.ShouldBe((ulong)1);
|
||||
|
||||
var msg1 = await reopened.LoadAsync(1, default);
|
||||
msg1.ShouldNotBeNull();
|
||||
msg1.Subject.ShouldBe("orders.created");
|
||||
}
|
||||
finally
|
||||
{
|
||||
if (Directory.Exists(dir))
|
||||
Directory.Delete(dir, recursive: true);
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user