Skip to content

Commit 7432a72

Browse files
committed
Use separately named cluster for cross cluster search integration tests
This commit reverts the use of RemoteCluster as the name of the remote cluster for CrossClusterSearch. DefaultSeeder updates settings for RemoteCluster which interfere with the test assertions
1 parent 69bb668 commit 7432a72

File tree

2 files changed

+7
-4
lines changed

2 files changed

+7
-4
lines changed

src/Tests/Tests.Core/ManagedElasticsearch/Clusters/CrossCluster.cs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,15 +7,17 @@ namespace Tests.Core.ManagedElasticsearch.Clusters
77
/// </summary>
88
public class CrossCluster : ClientTestClusterBase
99
{
10+
public static string ClusterTwo = "cluster_two";
11+
1012
protected override void SeedCluster()
1113
{
1214
new DefaultSeeder(Client).SeedNode();
1315

1416
// persist settings for cross cluster search, when remote-cluster is not available
1517
Client.ClusterPutSettings(s => s
1618
.Persistent(d => d
17-
.Add($"cluster.remote.{DefaultSeeder.RemoteClusterName}.seeds", new [] { "127.0.0.1:9399" })
18-
.Add($"cluster.remote.{DefaultSeeder.RemoteClusterName}.skip_unavailable", true)
19+
.Add($"cluster.remote.{ClusterTwo}.seeds", new [] { "127.0.0.1:9399" })
20+
.Add($"cluster.remote.{ClusterTwo}.skip_unavailable", true)
1921
)
2022
);
2123
}

src/Tests/Tests/Search/Search/SearchApiTests.cs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
using Tests.Domain;
1212
using Tests.Framework;
1313
using Tests.Framework.Integration;
14+
using static Tests.Core.ManagedElasticsearch.Clusters.CrossCluster;
1415

1516
namespace Tests.Search.Search
1617
{
@@ -528,7 +529,7 @@ public CrossClusterSearchApiTests(CrossCluster cluster, EndpointUsage usage) : b
528529
.MatchAll()
529530
);
530531

531-
private static string RemoteIndex => $"{DefaultSeeder.RemoteClusterName}:project";
532+
private static string RemoteIndex => $"{ClusterTwo}:project";
532533

533534
protected override HttpMethod HttpMethod => HttpMethod.POST;
534535

@@ -537,7 +538,7 @@ public CrossClusterSearchApiTests(CrossCluster cluster, EndpointUsage usage) : b
537538
Query = new QueryContainer(new MatchAllQuery())
538539
};
539540

540-
protected override string UrlPath => $"/project%2C{DefaultSeeder.RemoteClusterName}%3Aproject/doc/_search";
541+
protected override string UrlPath => $"/project%2C{ClusterTwo}%3Aproject/doc/_search";
541542

542543
protected override LazyResponses ClientUsage() => Calls(
543544
(c, f) => c.Search(f),

0 commit comments

Comments
 (0)