From d903f5f23be27bb00d148c0598eea213c725d655 Mon Sep 17 00:00:00 2001 From: Panagiotis Charalampous Date: Wed, 18 Mar 2026 10:04:52 +0200 Subject: [PATCH] Replace `StopAsync` with `DisposeAsync` so that containers are deleted after testing stops. --- src/Enhanced.Testing.Component/ContainerHarness.cs | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/Enhanced.Testing.Component/ContainerHarness.cs b/src/Enhanced.Testing.Component/ContainerHarness.cs index e523886..66aca51 100644 --- a/src/Enhanced.Testing.Component/ContainerHarness.cs +++ b/src/Enhanced.Testing.Component/ContainerHarness.cs @@ -1,5 +1,4 @@ using DotNet.Testcontainers.Containers; -using Microsoft.Extensions.Configuration; namespace Enhanced.Testing.Component; @@ -54,7 +53,7 @@ protected override async Task OnStop(CancellationToken cancellationToken) { if (_container is not null) { - await _container.StopAsync(cancellationToken).ConfigureAwait(false); + await _container.DisposeAsync().ConfigureAwait(false); } }