You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Reuse a shared SQL Server container for integration tests #1325
Reduce integration-test startup time by creating one SQL Server Testcontainers instance per test run or shared fixture instead of starting a new SQL Server container for every scenario.
Scope
Introduce a shared SQL Server fixture/lifecycle for the integration-test project.
Keep SQL Server startup and health checking at fixture/run scope.
Use unique database names, schemas, or reliable reset logic so scenarios remain isolated.
Ensure dependent containers use the shared SQL Server connection details and mapped host port.
Keep cleanup deterministic and compatible with the existing shared-service handling.
Consider Testcontainers reuse only after fixture sharing is in place; if enabled, use a stable container identity/label and document cleanup expectations.
Acceptance criteria
SQL Server starts at most once for the relevant integration-test run.
Scenarios can run without leaking rows, schemas, or migrations into one another.
SQL Server is cleaned up when the fixture/test run completes, including failure paths.
Parallel execution behavior is documented or explicitly prevented where shared state makes it unsafe.
Capture before/after startup timing for the integration-test suite.
Activity