Absorb the hand-rolled IAsyncLifetime template in TenantPartitionedEventsTests - #5100
Merged
Merged
Conversation
…entsTests Phase 2 of the test-harness standardization program. Eighteen files re-declared the same per-class store lifecycle (drop a pid+guid schema, build a DocumentStore with the common partitioned-tenancy config, ensure event storage, dispose). The new Fixtures/PartitionedStoreContext base owns that lifecycle; subclasses declare a SchemaPrefix and put only their file-local event types/projections/flags in a ConfigureStore override, which runs after the common config so it can override any line of it. Virtual hooks cover the deviants: EnsureStorageOnInitialize=false (event_metadata_propagation), DropSchemaOnInitialize=false + custom BuildSchemaName (per_tenant_rebuild_cancellation), InitializeAsync overrides for static-state resets (determine_action_async, raw_iprojection), and a re-entrant BuildFreshStoreAsync for Bug_4596's per-attempt store rebuild. schema_update_preserves_existing_per_tenant_sequences picks up ProcessId in its schema name via the base — an isolation improvement, not a change in what it tests. Left out on purpose: Migration/conjoined_to_partitioned_migration (two structurally different stores, one deliberately unpartitioned), Regressions/Bug_5044_natural_key_table_migration (repeated store construction IS the test), and all of Sharded/* (a different, already uniform collection-fixture template — candidate for its own sharded base in a later pass). Net -449 lines. TPE suite net9.0: 238 passed, 0 failed, 2 pre-existing skips; net10.0 compiles. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01U99pVx6kXwiGmaBUGLv7jB
19 tasks
This was referenced Aug 4, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Phase 2 of the test-harness standardization program (
HANDOFF-test-harness-standardization.md): 18 TenantPartitionedEventsTests files re-declared the same copy-pasteIAsyncLifetimelifecycle (drop pid+guid schema →DocumentStore.Forwith the common partitioned config →EnsureStorageExistsAsync→ dispose). They now inheritFixtures/PartitionedStoreContext, declaring only aSchemaPrefixand aConfigureStoreoverride with their file-local event types/projections/flags. Net −449 lines.ConfigureStoreruns after the common config lines (Conjoined,UseTenantPartitionedEvents,QuickWithServerTimestamps,AllDocumentsAreMultiTenanted), so per-file deviations still work by overriding in place. Virtual hooks cover the non-template cases:EnsureStorageOnInitialize => false—event_metadata_propagation_under_partitioningDropSchemaOnInitialize => false+BuildSchemaName()override —per_tenant_rebuild_cancellation(stablerebuild_cancel_{pid}schema)InitializeAsyncoverrides for static-state resets —determine_action_async_per_tenant,raw_iprojection_per_tenantBuildFreshStoreAsync()—Bug_4596's concurrency test rebuilds the whole store per attemptDeliberately not migrated (classified before writing the base):
Migration/conjoined_to_partitioned_migration.cs— two structurally different stores, one deliberately not partitioned.Regressions/Bug_5044_natural_key_table_migration.cs— holds no store; repeated store construction is the behavior under test.Sharded/*files — they share a different, already-uniform template (collection fixture + 3-shard scrub +BuildStore()in test bodies). Four of them omit theQuickWithServerTimestampsline, so a naive shared base would change what they test; a dedicated sharded base is a candidate follow-up.Verification: TPE suite net9.0 238 passed / 0 failed / 2 pre-existing skips; net10.0 compiles clean.
🤖 Generated with Claude Code
https://claude.ai/code/session_01U99pVx6kXwiGmaBUGLv7jB