Skip to content

Tests: dispose derived web hosts so the full suite stops wedging (closes #1171) - #1172

Merged
arnelirobles merged 4 commits into
masterfrom
bugfix/1171-dispose-derived-hosts
Oct 19, 2026
Merged

arnelirobles merged 4 commits into
masterfrom
bugfix/1171-dispose-derived-hosts

Conversation

@arnelirobles

Copy link
Copy Markdown
Contributor

The shared IntegrationTestFixture now tracks every host derived with WithWebHostBuilder and disposes the ones a finished class built when another class derives its first host. Before, about 60 call sites left their hosts running to the end of the run, each polling Postgres on unpooled connections.

FastEndpoints keeps a static ServiceResolver.Instance, set by each host that maps endpoints. Disposing the last such host left it on a disposed provider, which is why FileStoreSeamTests said never to dispose. After a release the fixture moves it to the newest host still up (FastEndpointsResolver.RepairIfDisposed).

  • fixture teardown now throws if any host it started is still running
  • OAuthProviderStub shares one host across four classes, so it uses WithRunScopedHost and lives to the end of the run
  • new DerivedHostReleaseTests covers release, the still-in-use case, the run-scoped case and the resolver pointer

Built clean. Tests are queued (full tier, job 162), not run yet.

Fixes #1171

@arnelirobles
arnelirobles added this pull request to the merge queue Oct 19, 2026
Merged via the queue into master with commit 163a8f1 Oct 19, 2026
17 checks passed
@arnelirobles
arnelirobles deleted the bugfix/1171-dispose-derived-hosts branch October 19, 2026 13:01
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.

Tests: dispose derived web hosts so the full suite stops wedging

1 participant