Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions dotnet-etcd.Tests/Integration/WatchResilienceTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,10 @@ public class WatchResilienceTests : IDisposable
private readonly EtcdClient _client;
private readonly string _testKeyPrefix = "watch-resilience-";

// Use etcd1 (port 2379) as per standard test env
private const string EtcdUrl = "http://localhost:2379";
private const string ContainerName = "etcd1";
// Dedicated single-node etcd (port 2409) so pausing/restarting the server here never
// disrupts the shared etcd1 cluster used by the other integration tests.
private const string EtcdUrl = "http://localhost:2409";
private const string ContainerName = "etcd-resilience";

public WatchResilienceTests()
{
Expand Down
17 changes: 17 additions & 0 deletions dotnet-etcd.Tests/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,23 @@ services:
networks:
- etcd-net

# Dedicated single-node etcd for WatchResilienceTests, which pause/restart their server.
# Isolated on its own port so that disruption never affects the shared etcd1 cluster tests.
etcd-resilience:
image: quay.io/coreos/etcd:v3.5.21
container_name: etcd-resilience
ports:
- "2409:2379"
command:
- /usr/local/bin/etcd
- --name=etcd-resilience
- --data-dir=/etcd-data
- --listen-client-urls=http://0.0.0.0:2379
- --advertise-client-urls=http://localhost:2409
restart: always
networks:
- etcd-net

networks:
etcd-net:
driver: bridge
4 changes: 4 additions & 0 deletions dotnet-etcd.Tests/dotnet-etcd.Tests.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,10 @@
<Content Include="certs\**">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<!-- Serialize test collections: the integration tests share a single etcd instance and
mutate global state (auth enable/disable, server restart), so running collections in
parallel causes cross-test interference and flakiness. -->
<None Include="xunit.runner.json" CopyToOutputDirectory="PreserveNewest" />
</ItemGroup>

</Project>
4 changes: 4 additions & 0 deletions dotnet-etcd.Tests/xunit.runner.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"$schema": "https://xunit.net/schema/current/xunit.runner.schema.json",
"parallelizeTestCollections": false
}
Loading