Skip to content

Absorb the sharded scrub template in TenantPartitionedEventsTests/Sharded - #5103

Merged
jeremydmiller merged 1 commit into
masterfrom
test/sharded-partitioned-base
Aug 1, 2026
Merged

Absorb the sharded scrub template in TenantPartitionedEventsTests/Sharded#5103
jeremydmiller merged 1 commit into
masterfrom
test/sharded-partitioned-base

Conversation

@jeremydmiller

Copy link
Copy Markdown
Member

Continuation of the test-harness standardization program: the 14 uniform classes on the sharded-tenant-partitioned collection re-declared the same per-test scrub (drop master sharded schema → per shard: drop tenants + wipe mt_* from public) and store-disposal bookkeeping. They now inherit Sharded/ShardedPartitionedContext. Net −351 lines.

Design notes:

  • BuildShardedStore(configure) provides the standard three-shard wiring + common partitioned-event config (AutoCreate deliberately left per-file — files split between All and the default). Only 3 files matched it exactly.
  • The other 11 keep their DocumentStore.For wiring verbatim (most omit UseSmallestDatabaseAssignment; two add doc-level partitioning; one has a config hook inside the sharding block) and are just wrapped in TrackStore — no store configuration changed, only lifecycle absorbed.
  • Bug_4944 keeps its extra non-Marten foreign_app/other_app_ledger cleanup via an InitializeAsync override on top of the base scrub.
  • Note: setting AppendMode = QuickWithServerTimestamps in the builder is behavior-neutral for files that omitted the line — it's the V9 default (EventGraph.cs:99), which defuses the classification concern about the 4 files without it.

Left alone: Bug_4863_4855 (own collection + 2-shard fixture + own schemas), sharded_progress_reading_4797 (drops a different schema set, skips the public-schema wipe), multi_node_hotcold_sharded_partitioned_events + dynamic_tenant_lifecycle_on_shard_during_daemon (IHost-based — candidates for HostedStoreContext follow-up).

Verification: TPE suite net9.0 238 passed / 0 failed / 2 pre-existing skips (includes the mid-test store-dispose case in Bug_4942); net10.0 compiles.

🤖 Generated with Claude Code

https://claude.ai/code/session_01U99pVx6kXwiGmaBUGLv7jB

…rded

Follow-up to the PartitionedStoreContext absorption: 14 classes on the
"sharded-tenant-partitioned" collection re-declared the identical per-test
scrub (drop the master "sharded" schema, then per shard: drop "tenants" and
wipe every mt_* object from public) plus per-file store disposal
bookkeeping. The new Sharded/ShardedPartitionedContext base owns the scrub
and tracked disposal; BuildShardedStore offers the standard three-shard
wiring for files that match it, and TrackStore covers the rest.

Migration was deliberately conservative: most files' sharding blocks omit
UseSmallestDatabaseAssignment or add doc-level partitioning, so their
DocumentStore.For wiring is kept verbatim and only wrapped in TrackStore —
no store configuration changed. Bug_4944 keeps its extra
foreign_app/other_app_ledger cleanup via an InitializeAsync override.

Left alone: Bug_4863_4855 (own collection + 2-shard fixture + own schema
names), sharded_progress_reading_4797 (different scrub set), and the two
IHost-based files (multi_node_hotcold, dynamic_tenant_lifecycle).

Net -351 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
@jeremydmiller
jeremydmiller merged commit 68be6ba into master Aug 1, 2026
10 checks passed
@jeremydmiller
jeremydmiller deleted the test/sharded-partitioned-base branch August 1, 2026 14:46
jeremydmiller added a commit that referenced this pull request Aug 1, 2026
Continues the phase-2 harness standardization (#5098-#5103): the DaemonTests
side of the inline Host.CreateDefaultBuilder + AddMarten pattern moves onto
the shared HostedStoreContext harness from #5102, retiring nine hard-coded
schema literals (bug2073, bug3059, coordinator, missing_events,
subscriptions_start, ioc, bluegreen, feature_4284_net*, eao_*) in favor of
per-class schema names, and letting the harness own host lifetime.

Migrated:
- Bugs/Bug_2073_tenancy_problems
- Bugs/Bug_3059_double_application
- Composites/Feature_4284_composite_projection_with_services
- Internals/pausing_and_resuming_the_daemon
- Resiliency/skipping_unknown_event_types_in_continuous_builds (also fixes
  the NRE in DisposeAsync when a test failed before _processor was assigned)
- Subscriptions/subscribe_from_present
- Subscriptions/subscriptions_end_to_end: the five host-based tests split out
  of the OneOffConfigurationsContext class into a new
  subscription_registrations_through_host: HostedStoreContext class;
  subscriptions_are_part_of_the_event_store_usage keeps a hand-rolled host
  because it asserts exactly one IEventStore registration and the harness's
  main store would add a second
- EventSourcingTests/event_append_observation (per-test schema suffixes now
  derive from SchemaName)
- DaemonTests.ManualOnly/Coordination/blue_green_projection_deployments

Also fixes a latent ManualOnly breakage: BlueProjection/GreenProjection use
conventional Apply methods but were not declared partial, so 4 of the 5
blue/green tests failed on master with "No source-generated dispatcher
found". Both are partial now and all 5 pass.

Deliberately untouched: Internals/service_registrations (Build()-only Lamar
container assertions, no started host), Bug_3080 +
MultiTenancy/dynamic_spin_up_of_dynamic_tenants + multi_tenancy_by_database
(real multi-database provisioning that does not fit the single-connection
harness), Examples/* and Projections/testing_projections.cs (doc snippets),
Daemon/postgres_listen_notify_wakeup_tests.cs (#4961 in flight), and the four
TenantPartitionedEventsTests multi-node host files (follow-up).

net9.0: DaemonTests 260/260, EventSourcingTests event_append_observation 8/8,
ManualOnly blue_green 5/5.


Claude-Session: https://claude.ai/code/session_01U99pVx6kXwiGmaBUGLv7jB

Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant