Skip to content

Conversation

@Meir017
Copy link
Contributor

@Meir017 Meir017 commented Oct 5, 2025

just saw #9701 and realized we can further simplify the tests by using testcontainers

Replaces manual Docker container management in CI workflows with Testcontainers library for better test isolation and reliability.

Removes hardcoded Consul setup from GitHub Actions workflow and updates test utilities to programmatically manage container lifecycle.

Updates Testcontainers dependency to latest version for improved compatibility.

no setup on my machine, tests just work -
image

Microsoft Reviewers: Open in CodeFlow

Replaces manual Docker container management in CI workflows with Testcontainers library for better test isolation and reliability.

Removes hardcoded Consul setup from GitHub Actions workflow and updates test utilities to programmatically manage container lifecycle.

Updates Testcontainers dependency to latest version for improved compatibility.
@Meir017
Copy link
Contributor Author

Meir017 commented Oct 26, 2025

@ReubenBond I think the two github-actions that failed are unstable, all actions passed

@ReubenBond
Copy link
Member

@Meir017 they look like Consul failures, based on the output:

Error: System.TypeInitializationException : The type initializer for 'Consul.Tests.ConsulTestUtils' threw an exception.
---- DotNet.Testcontainers.Builders.DockerUnavailableException : Docker is either not running or misconfigured. Please ensure that Docker is running and that the endpoint is properly configured.
You can customize your configuration using either the environment variables or the ~/.testcontainers.properties file.
For more information, visit: [https://dotnet.testcontainers.org/custom_configuration/.](https://dotnet.testcontainers.org/custom_configuration/)
  Details: 
    Failed to connect to Docker endpoint at 'unix:///var/run/docker.sock'.
    Failed to connect to Docker endpoint at 'unix:///var/run/docker.sock'.
-------- System.AggregateException : One or more errors occurred. (Failed to connect to Docker endpoint at 'unix:///var/run/docker.sock'.) (Failed to connect to Docker endpoint at 'unix:///var/run/docker.sock'.)
------------ DotNet.Testcontainers.Builders.DockerUnavailableException : Failed to connect to Docker endpoint at 'unix:///var/run/docker.sock'.
---------------- System.Net.Http.HttpRequestException : Connection failed.
-------------------- System.Net.Sockets.SocketException : Can't assign requested address
------------ DotNet.Testcontainers.Builders.DockerUnavailableException : Failed to connect to Docker endpoint at 'unix:///var/run/docker.sock'.
---------------- System.Net.Http.HttpRequestException : Connection failed.
--------  Skipped ------------ System.Net.Sockets.SocketException : Can't assign requested address

@Meir017
Copy link
Contributor Author

Meir017 commented Oct 26, 2025

hmm, wer'e getting the error

Error: System.AggregateException : One or more errors occurred. (Docker API responded with status code=BadRequest, response={"message":"invalid CapAdd: unknown capability: \"CAP_IPC_LOCK\""}

seems to be related to this https://github.com/testcontainers/testcontainers-dotnet/blob/4a72cb31f51206eb9f5d710fc6621650fdab89ee/src/Testcontainers.Consul/ConsulBuilder.cs#L50C27-L50C28

I'll check this out

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants