| Filename | Latest commit message | Latest commit date |
|---|---|---|
An attached store takes its cache's gate as its own lock (CacheBackingStore.Gate), so a pull's load callback into the cache can no longer take the gate after the store lock. The directory store's private mutation gate is deleted; the single-file pull now runs under the gate; PullAllBackingStoresAsync takes the gate around each store's pull. Fixes the pull/upsert deadlock on directory stores and the re-pull that erased a staged single-file write. An unconditional single-file Commit writes the store's whole view plus the batch, exactly as a flush would, instead of merging onto the file; it persists earlier staged writes and leaves the store clean. Conditional commits still land onto the file under the lock. Directory-store commit and flush already share one generation writer (staged keys onto the current manifest) and are unchanged. Contracts state both rules, the lock order, that OnUpdate fires for loads only, that a missing single file keeps staged writes, and that a store failing to hydrate on open throws and is left byte-identical. Tests: PullAndUpsertOnDirectoryStoreDoNotDeadlock, RepullNeverErasesAStagedWrite, UnconditionalCommitIsLastWriterWinsLikeFlush, UnconditionalCommitPersistsStagedWrites, OpeningACorruptStoreThrowsAndLeavesItUntouched. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> |
||
| .. | ||
| Fixtures | ||
| BackingStoreTests.cs | ||
| ConditionalCommitTests.cs | ||
| CultDocumentRegistryTests.cs | ||
| DirectoryStoreDurabilityTests.cs | ||
| GameCult.Caching.Tests.csproj | ||
| PreCut2FixtureDocuments.cs | ||
| PreCut2StoreFormatTests.cs | ||
| README.md | ||
| StoreRoutingTests.cs | ||
GameCult.Caching.Tests
GameCult.Caching.Tests contains NUnit tests for the caching library and its
MessagePack persistence stores.
Scope
The tests currently cover:
SingleFileMessagePackBackingStoreround-trips, external pulls, and the dirty-pull guardDirectoryMessagePackBackingStorewith thecultcache.store.v4.directory-content-addressed-pagesmanifest: page writes, clean flushes, concurrent writers under the commit lease, external deltas, unflushed local keys, orphaned pages, and observers running after the lease is releasedCultCacheMessagePack.OpenAsync, persisted globals, dirty state, and flush on dispose- cache lookups (
Get,GetAll, runtime-type upserts) CultCache.Commitbatches on a directory store: visibility after the store commits, abandoned stages, sealed batches, observers committing again- explicit Cult document payload codecs, generated metadata, canonical schema fixtures, and schema drift reports
- hand-written MessagePack snapshot and record serialization
StoreRoutingTests: the store-composition contract (routing, attachment is hydration, read-only stores, global singletons, assignable lookups, batches, all-or-nothing loads)ConditionalCommitTests:Expect,ExpectUnchanged,TryCommit, the single-file lock, strictly increasingstoredAt, and the same conditions on a directory storeDirectoryStoreDurabilityTests: failed manifest replace, content-addressed pages, the commit lease, orphan pages and tampered pages, with faults from real file locksPreCut2StoreFormatTests: stores written before Cut 2 still open
Selective hydration, the directory store's stage probes, pre-v4 directory
formats, and the SoA table are no longer in the tree; the SoA table is parked
at parked/cultcache-soa (docs/parked-features.md).
Run
dotnet test tests\GameCult.Caching.Tests\GameCult.Caching.Tests.csproj