Deffiss / testenvironment-docker

MIT License
117 stars 30 forks source link

SQL Server container fails to start on latest version of Docker (3.3.3) on MacOS #52

Closed josephwoodward closed 3 years ago

josephwoodward commented 3 years ago

SQL Server container fails to start on latest version of Docker

Running this test fails with the following error when using the latest version of Docker Desktop (3.3.3) on a Mac.

I've tested this on a Windows machine and it looks like it doesn't return the IPv6 address.

Here's the stacktrace:

TestEnvironment.Docker.Tests.DockerEnvironmentTests.AddMsSqlContainer_WhenContainerIsUp_ShouldPrintMsSqlVersion

System.ArgumentException: An item with the same key has already been added. Key: 1433

System.ArgumentException
An item with the same key has already been added. Key: 1433
   at System.Collections.Generic.Dictionary`2.TryInsert(TKey key, TValue value, InsertionBehavior behavior)
   at System.Linq.Enumerable.ToDictionary[TSource,TKey,TElement](List`1 source, Func`2 keySelector, Func`2 elementSelector, IEqualityComparer`1 comparer)
   at TestEnvironment.Docker.Container.RunContainerSafely(String[] environmentVariables, CancellationToken token) in /Users/joseph.woodward/Documents/git/Personal/testenvironment-docker/src/TestEnvironment.Docker/Container.cs:line 210
   at TestEnvironment.Docker.Container.Run(IDictionary`2 environmentVariables, CancellationToken token) in /Users/joseph.woodward/Documents/git/Personal/testenvironment-docker/src/TestEnvironment.Docker/Container.cs:line 84
   at TestEnvironment.Docker.DockerEnvironment.Up(CancellationToken token) in /Users/joseph.woodward/Documents/git/Personal/testenvironment-docker/src/TestEnvironment.Docker/DockerEnvironment.cs:line 43
   at TestEnvironment.Docker.Tests.DockerEnvironmentTests.AddMsSqlContainer_WhenContainerIsUp_ShouldPrintMsSqlVersion() in /Users/joseph.woodward/Documents/git/Personal/testenvironment-docker/test/TestEnvironment.Docker.Tests/DockerEnvironmentTests.cs:line 103
   at Xunit.Sdk.TestInvoker`1.<>c__DisplayClass48_1.<<InvokeTestMethodAsync>b__1>d.MoveNext() in C:\Dev\xunit\xunit\src\xunit.execution\Sdk\Frameworks\Runners\TestInvoker.cs:line 264
--- End of stack trace from previous location where exception was thrown ---
   at Xunit.Sdk.ExecutionTimer.AggregateAsync(Func`1 asyncAction) in C:\Dev\xunit\xunit\src\xunit.execution\Sdk\Frameworks\ExecutionTimer.cs:line 48
   at Xunit.Sdk.ExceptionAggregator.RunAsync(Func`1 code) in C:\Dev\xunit\xunit\src\xunit.core\Sdk\ExceptionAggregator.cs:line 90

image

Deffiss commented 3 years ago

Hi, thanks for your fix, please check out latest package version.

josephwoodward commented 3 years ago

Thanks 👍