Migrate DaemonTests inline-host tests onto HostedStoreContext - #5104
Merged
Conversation
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. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01U99pVx6kXwiGmaBUGLv7jB
This was referenced Aug 1, 2026
jeremydmiller
added a commit
that referenced
this pull request
Aug 1, 2026
…esses (#5106) Phase-2 harness standardization, CoreTests hotspot (follows #5104/#5105). Nine inline-host files move onto HostedStoreContext (newly Compile-linked into CoreTests.csproj): Bugs/Bug_4185, Bugs/Bug_4187, Bugs/Bug_5039, configuring_marten_with_async_extensions (the sample_registering_async_config snippet line stays verbatim inside the configureServices lambda), document_store_diagnostics_tests (8 doc_diag_* literals) and document_store_usage_tests (6 doc_usage_* literals; literal-schema assertions rewritten against SchemaName), lazy_ancillary_store_registration, setting_solo_mode_in_test_support, and working_with_initial_data (deletes the local MartenHost wrapper; ancillary stores get SchemaName-derived schemas). Four files move onto / are cleaned up within OneOffConfigurationsContext: request_count_tracking (also fixes its wrong-order hand-rolled Dispose), migrate_from_guid_to_int_based_revisions (StoreOptions + SeparateStore over the shared "migrations" literal), SessionOptionsTests (four leaked custom-connection stores become tracked SeparateStore calls), and a stray undisposed store in EventTracingConnectionLifetimeTests gets await using. Deliberately untouched, by classification: the five Partitioning/* files (disciplined ProcessId-suffixed schemas plus a second partition-management schema the OneOff base cannot express - same call as the TPE multi-node files); disposal-semantics tests (Bug_4874 trio, Bug_4915); DI-registration assertion tests (bootstrapping_with_service_collection_extensions, daemon_mode_externally_managed, jasper_fx_mechanics); doc-sample files (BootstrappingExamples, Examples/*, Bug_962); and pure options unit tests (StoreOptionsTests, row_level_security_unit_tests, applying_metrics, extended_progression_gate, constructing_projection_coordinator...). net9.0: CoreTests 519 passed / 0 failed (1 pre-existing skip). Claude-Session: https://claude.ai/code/session_01U99pVx6kXwiGmaBUGLv7jB Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
jeremydmiller
added a commit
that referenced
this pull request
Aug 1, 2026
…ction (#5107) Phase-2 harness standardization, MultiTenancyTests hotspot (follows #5104-#5106). Scope note: unlike the prior migrations, the host/tenancy construction in these files IS the test subject (master-table vs static vs per-database strategies), so the hand-built hosts stay. The standardization win here is the shared plumbing: - New Marten.Testing/Harness/TenantDatabases: provisions per-tenant databases on the test server and hands back connection strings. Uses the race-tolerant body from projection_statuses_per_database (check-then-create is not atomic across concurrent TFM runs; the loser of the race swallows DuplicateDatabase/UniqueViolation). Replaces TEN per-file CreateDatabaseIfNotExists copies. DocumentStore_IMartenStorage keeps a thin wrapper that adds its schema drops on top. - The "multi-tenancy" xUnit collection had NINE duplicate [CollectionDefinition("multi-tenancy", DisableParallelization = true)] declarations, each decorating a test class without enrolling it - only projection_statuses_per_database actually joined via [Collection]. One definition now lives in MultiTenancyCollection.cs and the nine classes join the collection properly. Behavior-neutral today (the assembly disables parallelization outright) but now expresses the actual intent. net9.0: MultiTenancyTests 159/159. Claude-Session: https://claude.ai/code/session_01U99pVx6kXwiGmaBUGLv7jB Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
19 tasks
This was referenced Aug 4, 2026
Open
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.
Continues the phase-2 test-harness standardization (#5098–#5103). The DaemonTests side of the inline
Host.CreateDefaultBuilder+AddMartenpattern moves onto the sharedHostedStoreContextharness introduced in #5102 — per-class schema names instead of nine hard-coded literals (bug2073,bug3059,coordinator,missing_events,subscriptions_start,ioc,bluegreen,feature_4284_net*,eao_*), and host lifetime owned by the harness (hosts stopped and disposed newest-first at class teardown). Net −205 lines.Migrated
Bugs/Bug_2073_tenancy_problemsBugs/Bug_3059_double_applicationComposites/Feature_4284_composite_projection_with_servicesInternals/pausing_and_resuming_the_daemonResiliency/skipping_unknown_event_types_in_continuous_builds— also fixes the NRE inDisposeAsyncwhen a test failed before_processorwas assignedSubscriptions/subscribe_from_presentSubscriptions/subscriptions_end_to_end— the five host-based tests split out of theOneOffConfigurationsContextclass into a newsubscription_registrations_through_host: HostedStoreContextclass.subscriptions_are_part_of_the_event_store_usagekeeps a hand-rolled host on purpose: it asserts exactly oneIEventStoreregistration, and the harness's mainAddMartenstore would add a second.EventSourcingTests/event_append_observation— per-test schema suffixes now derive fromSchemaNameDaemonTests.ManualOnly/Coordination/blue_green_projection_deploymentsDrive-by fix: blue/green tests were broken on master
BlueProjection/GreenProjectionuse conventionalApplymethods but were not declaredpartial, so 4 of the 5 blue/green tests failed on master with "No source-generated dispatcher found" (ManualOnly isn't in CI, so nothing caught it). Both arepartialnow and all 5 pass.Deliberately untouched
Internals/service_registrations—Build()-only Lamar container assertions, no started hostBugs/Bug_3080,MultiTenancy/dynamic_spin_up_of_dynamic_tenants,MultiTenancy/multi_tenancy_by_database— real multi-database provisioning that doesn't fit the single-connection harnessExamples/*,Projections/testing_projections.cs— doc snippets where the inline host is the sampleDaemon/postgres_listen_notify_wakeup_tests.cs— Async daemon stops projecting permanently after a brief DB outage whenUseListenNotifyForEventAppendsis enabled —HighWaterAgentloop dies and is never restarted #4961 work in flightVerification
net9.0 local: full DaemonTests suite 260/260,
event_append_observation8/8, ManualOnlyblue_green_projection_deployments5/5.🤖 Generated with Claude Code
https://claude.ai/code/session_01U99pVx6kXwiGmaBUGLv7jB