From 3591d0410446977db7d246abda3be0a95dfe5a59 Mon Sep 17 00:00:00 2001 From: Jonas Hendrickx Date: Wed, 21 Aug 2024 17:42:58 +0200 Subject: [PATCH] Wait Strategy needs to be changed for TestContainers (#692) --- tests/Api.IntegrationTests/PasswordlessApiFixture.cs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/tests/Api.IntegrationTests/PasswordlessApiFixture.cs b/tests/Api.IntegrationTests/PasswordlessApiFixture.cs index 68801e9d3..49f193537 100644 --- a/tests/Api.IntegrationTests/PasswordlessApiFixture.cs +++ b/tests/Api.IntegrationTests/PasswordlessApiFixture.cs @@ -1,3 +1,4 @@ +using DotNet.Testcontainers.Builders; using Testcontainers.MsSql; using Xunit; @@ -5,7 +6,10 @@ namespace Passwordless.Api.IntegrationTests; public class PasswordlessApiFixture : IAsyncDisposable, IAsyncLifetime { - private readonly MsSqlContainer _dbContainer = new MsSqlBuilder().Build(); + private readonly MsSqlContainer _dbContainer = new MsSqlBuilder() + .WithImage("mcr.microsoft.com/mssql/server:2022-CU14-ubuntu-22.04") + .WithWaitStrategy(Wait.ForUnixContainer().UntilCommandIsCompleted("/opt/mssql-tools18/bin/sqlcmd", "-C", "-Q", "SELECT 1;")) + .Build(); public async Task InitializeAsync() => await _dbContainer.StartAsync();