I been adding a integration test using Testcontainers
Building my container like this in my IntegrationTestFactory.cs
private readonly MsSqlContainer _dbContainer = new MsSqlBuilder()
.Build();
Was a bit surprise how easy it would work locally but when pushing it into Azure Pipeline it fails with this error
Error Message:
Microsoft.Data.SqlClient.SqlException : A network-related or instance-specific error occurred while establishing a connection to SQL Server. The server was not found or was not accessible. Verify that the instance name is correct and that SQL Server is configured to allow remote connections. (provider: TCP Provider, error: 35 - An internal exception was caught)
---- System.Net.Sockets.SocketException : Resource temporarily unavailable
also tried adding this
.WithImage("mcr.microsoft.com/mssql/server:2019-latest")
But still fails.
My log says :
[testcontainers.org 00:00:04.06] Execute "/opt/mssql-tools/bin/sqlcmd -Q SELECT 1;" at Docker container e7255388023f
##[debug]Agent environment resources - Disk: / Available 18225.00 MB out of 74244.00 MB, Memory: Used 2097.00 MB out of 6921.00 MB, CPU: Usage 5.18%
[testcontainers.org 00:00:10.27] Docker container e7255388023f ready
So it looks to me like the contianer is all good
What did I miss?