Add XML docs required by CommentChecker fixes
All checks were successful
NuGet Package Publish / nuget (push) Successful in 1m13s
All checks were successful
NuGet Package Publish / nuget (push) Successful in 1m13s
This commit is contained in:
@@ -12,6 +12,7 @@ namespace ZB.MOM.WW.CBDDC.Sample.Console.Tests;
|
||||
|
||||
public class SurrealOplogStoreContractParityTests : OplogStoreContractTestBase
|
||||
{
|
||||
/// <inheritdoc />
|
||||
protected override Task<IOplogStoreContractHarness> CreateHarnessAsync()
|
||||
{
|
||||
return Task.FromResult<IOplogStoreContractHarness>(new SurrealOplogStoreContractHarness());
|
||||
@@ -20,11 +21,15 @@ public class SurrealOplogStoreContractParityTests : OplogStoreContractTestBase
|
||||
|
||||
public class LmdbOplogStoreContractTests : OplogStoreContractTestBase
|
||||
{
|
||||
/// <inheritdoc />
|
||||
protected override Task<IOplogStoreContractHarness> CreateHarnessAsync()
|
||||
{
|
||||
return Task.FromResult<IOplogStoreContractHarness>(new LmdbOplogStoreContractHarness());
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Verifies prune operations clear index tables as expected.
|
||||
/// </summary>
|
||||
[Fact]
|
||||
public async Task Lmdb_IndexConsistency_InsertPopulatesAndPruneRemovesIndexes()
|
||||
{
|
||||
@@ -54,6 +59,9 @@ public class LmdbOplogStoreContractTests : OplogStoreContractTestBase
|
||||
after.OplogNodeHeadCount.ShouldBe(0);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Verifies prune retains newer entries while removing qualifying stale records.
|
||||
/// </summary>
|
||||
[Fact]
|
||||
public async Task Lmdb_Prune_RemovesAtOrBeforeCutoff_AndKeepsNewerInterleavedEntries()
|
||||
{
|
||||
@@ -79,6 +87,9 @@ public class LmdbOplogStoreContractTests : OplogStoreContractTestBase
|
||||
remaining.Contains(nodeANew.Hash).ShouldBeTrue();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Verifies node head values recompute correctly after prune operations.
|
||||
/// </summary>
|
||||
[Fact]
|
||||
public async Task Lmdb_NodeHead_AdvancesAndRecomputesAcrossPrune()
|
||||
{
|
||||
@@ -100,6 +111,9 @@ public class LmdbOplogStoreContractTests : OplogStoreContractTestBase
|
||||
(await store.GetLastEntryHashAsync("node-a")).ShouldBeNull();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Verifies durable persistence preserves node head after reopen.
|
||||
/// </summary>
|
||||
[Fact]
|
||||
public async Task Lmdb_RestartDurability_PreservesHeadAndScans()
|
||||
{
|
||||
@@ -121,6 +135,9 @@ public class LmdbOplogStoreContractTests : OplogStoreContractTestBase
|
||||
after[1].Hash.ShouldBe(entry2.Hash);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Verifies appending duplicate entries remains idempotent.
|
||||
/// </summary>
|
||||
[Fact]
|
||||
public async Task Lmdb_Dedupe_DuplicateHashAppendIsIdempotent()
|
||||
{
|
||||
@@ -137,6 +154,9 @@ public class LmdbOplogStoreContractTests : OplogStoreContractTestBase
|
||||
exported[0].Hash.ShouldBe(entry.Hash);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Verifies prune performance remains bounded under large synthetic datasets.
|
||||
/// </summary>
|
||||
[Fact]
|
||||
public async Task Lmdb_PrunePerformanceSmoke_LargeSyntheticWindow_CompletesWithinGenerousBudget()
|
||||
{
|
||||
@@ -164,30 +184,53 @@ internal sealed class SurrealOplogStoreContractHarness : IOplogStoreContractHarn
|
||||
{
|
||||
private readonly SurrealTestHarness _harness;
|
||||
|
||||
/// <summary>
|
||||
/// Initializes a new surrogate Surreal contract harness.
|
||||
/// </summary>
|
||||
public SurrealOplogStoreContractHarness()
|
||||
{
|
||||
_harness = new SurrealTestHarness();
|
||||
Store = _harness.CreateOplogStore();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets the active store instance.
|
||||
/// </summary>
|
||||
public IOplogStore Store { get; private set; }
|
||||
|
||||
/// <summary>
|
||||
/// Reopens the Surreal store and returns a fresh harness handle.
|
||||
/// </summary>
|
||||
public IOplogStore ReopenStore()
|
||||
{
|
||||
Store = _harness.CreateOplogStore();
|
||||
return Store;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Appends an entry into the Surreal store for a dataset.
|
||||
/// </summary>
|
||||
/// <param name="entry">The oplog entry to append.</param>
|
||||
/// <param name="datasetId">The dataset identifier for the append operation.</param>
|
||||
/// <param name="cancellationToken">The cancellation token.</param>
|
||||
public Task AppendOplogEntryAsync(OplogEntry entry, string datasetId, CancellationToken cancellationToken = default)
|
||||
{
|
||||
return ((SurrealOplogStore)Store).AppendOplogEntryAsync(entry, datasetId, cancellationToken);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Exports all entries for a dataset from the Surreal store.
|
||||
/// </summary>
|
||||
/// <param name="datasetId">The dataset identifier to export.</param>
|
||||
/// <param name="cancellationToken">The cancellation token.</param>
|
||||
public Task<IEnumerable<OplogEntry>> ExportAsync(string datasetId, CancellationToken cancellationToken = default)
|
||||
{
|
||||
return ((SurrealOplogStore)Store).ExportAsync(datasetId, cancellationToken);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Disposes Surreal harness resources.
|
||||
/// </summary>
|
||||
public ValueTask DisposeAsync()
|
||||
{
|
||||
return _harness.DisposeAsync();
|
||||
@@ -199,6 +242,9 @@ internal sealed class LmdbOplogStoreContractHarness : IOplogStoreContractHarness
|
||||
private readonly string _rootPath;
|
||||
private LmdbOplogStore? _store;
|
||||
|
||||
/// <summary>
|
||||
/// Initializes a new LMDB contract harness and backing store.
|
||||
/// </summary>
|
||||
public LmdbOplogStoreContractHarness()
|
||||
{
|
||||
_rootPath = Path.Combine(Path.GetTempPath(), "cbddc-lmdb-tests", Guid.NewGuid().ToString("N"));
|
||||
@@ -206,8 +252,14 @@ internal sealed class LmdbOplogStoreContractHarness : IOplogStoreContractHarness
|
||||
_store = CreateStore();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets the active LMDB store.
|
||||
/// </summary>
|
||||
public IOplogStore Store => _store ?? throw new ObjectDisposedException(nameof(LmdbOplogStoreContractHarness));
|
||||
|
||||
/// <summary>
|
||||
/// Recreates the LMDB store instance and returns it.
|
||||
/// </summary>
|
||||
public IOplogStore ReopenStore()
|
||||
{
|
||||
_store?.Dispose();
|
||||
@@ -215,18 +267,32 @@ internal sealed class LmdbOplogStoreContractHarness : IOplogStoreContractHarness
|
||||
return _store;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Appends an entry into the LMDB store for a dataset.
|
||||
/// </summary>
|
||||
/// <param name="entry">The oplog entry to append.</param>
|
||||
/// <param name="datasetId">The dataset identifier for the append operation.</param>
|
||||
/// <param name="cancellationToken">The cancellation token.</param>
|
||||
public Task AppendOplogEntryAsync(OplogEntry entry, string datasetId, CancellationToken cancellationToken = default)
|
||||
{
|
||||
return (_store ?? throw new ObjectDisposedException(nameof(LmdbOplogStoreContractHarness)))
|
||||
.AppendOplogEntryAsync(entry, datasetId, cancellationToken);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Exports all entries for a dataset from the LMDB store.
|
||||
/// </summary>
|
||||
/// <param name="datasetId">The dataset identifier to export.</param>
|
||||
/// <param name="cancellationToken">The cancellation token.</param>
|
||||
public Task<IEnumerable<OplogEntry>> ExportAsync(string datasetId, CancellationToken cancellationToken = default)
|
||||
{
|
||||
return (_store ?? throw new ObjectDisposedException(nameof(LmdbOplogStoreContractHarness)))
|
||||
.ExportAsync(datasetId, cancellationToken);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Disposes LMDB harness resources.
|
||||
/// </summary>
|
||||
public async ValueTask DisposeAsync()
|
||||
{
|
||||
_store?.Dispose();
|
||||
|
||||
Reference in New Issue
Block a user