Skip to content

Commit 2749cda

Browse files
authored
[tests] Work around sqlserver 2022-latest latest image breaking with testcontainers (#5058)
* [tests] Workaround sqlserver 2022-latest latest image failing .. with testcontainers because the path `/opt/mssql-tools/bin/sqlcmd` changed to `/opt/mssql-tools18/bin/sqlcmd`. But this hardcoded path is being used in testcontainers, causing it to fail. testcontainers/testcontainers-dotnet#1220 microsoft/mssql-docker#892 * add comment referencing the issue
1 parent 975a9fc commit 2749cda

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

tests/Aspire.Microsoft.Data.SqlClient.Tests/SqlServerContainerFixture.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33

44
using Aspire.Components.Common.Tests;
55
using Aspire.Hosting;
6+
using DotNet.Testcontainers.Builders;
67
using Testcontainers.MsSql;
78
using Xunit;
89

@@ -21,6 +22,7 @@ public async Task InitializeAsync()
2122
{
2223
Container = new MsSqlBuilder()
2324
.WithImage($"{SqlServerContainerImageTags.Registry}/{SqlServerContainerImageTags.Image}:{SqlServerContainerImageTags.Tag}")
25+
.WithWaitStrategy(Wait.ForUnixContainer().UntilCommandIsCompleted("/opt/mssql-tools18/bin/sqlcmd", "-C", "-Q", "SELECT 1;")) // https://github.com/dotnet/aspire/issues/5057
2426
.Build();
2527
await Container.StartAsync();
2628
}

0 commit comments

Comments
 (0)