Skip to content

Remove diagnostic ITestOutputHelper/TestOutputMartenLogger from tests#4136

Merged
jeremydmiller merged 7 commits intomasterfrom
test-optimizations
Feb 15, 2026
Merged

Remove diagnostic ITestOutputHelper/TestOutputMartenLogger from tests#4136
jeremydmiller merged 7 commits intomasterfrom
test-optimizations

Conversation

@jeremydmiller
Copy link
Member

@jeremydmiller jeremydmiller commented Feb 15, 2026

Summary

  • Remove ITestOutputHelper constructor injection and TestOutputMartenLogger diagnostic logging from ~120 test files across 7 test projects (CoreTests, DocumentDbTests, EventSourcingTests, LinqTests, MultiTenancyTests, PatchingTests, ValueTypeTests)
  • The TestOutputMartenLogger class itself is preserved for DaemonTests/StressTests usage
  • Move foreign_keys test class from DocumentDbTests to CoreTests
  • Add deadlock detection retry (250ms wait + 1 retry) to OneOffConfigurationsContext.StoreOptions() to handle transient PostgreSQL 40P01 errors
  • Remove blanket DeleteAllDocuments/DeleteAllEventData from IntegrationContext.InitializeAsync() to improve test performance
  • Add targeted ResetAllData() calls only where tests actually need clean state: via fixtureSetup() overrides for classes where all tests depend on it, and at individual test level for partial cases
  • Consolidate per-test ResetAllData() calls into fixtureSetup() overrides in 3 DocumentDbTests files (streaming_json_results, query_by_sql, ejecting_documents) — replacing 52 individual calls with 3 class-level overrides
  • Add IAsyncLifetime to archiving_events.cs with DeleteAllEventDataAsync() in InitializeAsync(), removing 6 redundant per-test cleanup calls
  • Remove disabled quick_append_timestamp test file — dead code containing 35 seconds of Task.Delay calls in a commented-out [Fact]
  • Replace per-test CompletelyRemoveAllAsync() with per-test schema drop via IAsyncLifetime in Using_Global/Local_DocumentSessionListener_Tests (21 calls removed)
  • Reduce all WaitForNonStaleData timeouts exceeding 15 seconds down to 15s (was 30s, 60s, 120s across 6 EventSourcingTests files)
  • Convert marten_managed_tenant_id_partitioning tests from OneOffConfigurationsContext to shared StoreFixture pattern, sharing a single DocumentStore/IHost across all 8 partition management tests

Test plan

  • Build succeeds with 0 errors
  • CoreTests: 287 passed, 0 failed
  • DocumentDbTests: 924 passed, 0 failed
  • EventSourcingTests: 1041 passed, 0 failed
  • LinqTests: 1207 passed, 0 failed
  • MultiTenancyTests: 106 passed, 0 failed
  • PatchingTests: 114 passed, 0 failed
  • ValueTypeTests: 308 passed, 0 failed
  • DaemonTests: 175 passed, 1 flaky (pre-existing, unrelated)

🤖 Generated with Claude Code

jeremydmiller and others added 7 commits February 15, 2026 11:44
… tests

Remove ITestOutputHelper constructor injection and TestOutputMartenLogger
diagnostic logging from ~120 test files across CoreTests, DocumentDbTests,
EventSourcingTests, LinqTests, MultiTenancyTests, PatchingTests, and
ValueTypeTests. These were only used for diagnostic SQL output and added
unnecessary constructor parameters and fields. The TestOutputMartenLogger
class itself is preserved for DaemonTests/StressTests usage.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Move the foreign_keys test class from DocumentDbTests/ForeignKeys to
CoreTests/ForeignKeys. Add deadlock detection retry logic to
OneOffConfigurationsContext.StoreOptions() - on PostgreSQL deadlock
(40P01), wait 250ms and retry once before failing.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Remove the DeleteAllDocuments/DeleteAllEventData calls from
IntegrationContext.InitializeAsync() to improve test performance.
Add targeted ResetAllData calls only where tests actually need
clean state: via fixtureSetup() overrides for classes where all
tests fail, and at individual test level for partial failures.

Also adds deadlock retry logic to OneOffConfigurationsContext.StoreOptions()
and moves foreign_keys tests from DocumentDbTests to CoreTests.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
…ant cleanup

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
…lays)

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
…outs

- Replace per-test CompletelyRemoveAllAsync with per-test schema drop via
  IAsyncLifetime in Using_Global/Local_DocumentSessionListener_Tests
- Reduce all WaitForNonStaleData timeouts exceeding 15s down to 15s
  (was 30s, 60s, 120s across 6 files)

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Share a single DocumentStore/IHost across all partition management tests
instead of creating a new store per test via StoreOptions(). Uses
schema drop + ResetSchemaExistenceChecks() in InitializeAsync to ensure
clean partition state between tests.

Co-Authored-By: Claude Opus 4.6 <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