Skip to content

Commit 60da69a

Browse files
committed
make sure we use the nodes from the cluster again, this was failing the x-pack cluster tests because we no longer went over http
(cherry picked from commit 1cb6609)
1 parent a0f0850 commit 60da69a

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

src/Tests/Tests.Core/Extensions/EphemeralClusterExtensions.cs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,9 @@ public static class EphemeralClusterExtensions
1313
public static ConnectionSettings CreateConnectionSettings<TConfig>(this IEphemeralCluster<TConfig> cluster)
1414
where TConfig : EphemeralClusterConfiguration
1515
{
16-
return new TestConnectionSettings();
16+
var clusterNodes = cluster.NodesUris(TestConnectionSettings.LocalOrProxyHost);
17+
//we ignore the uri's that TestConnection provides and seed with the nodes the cluster dictates.
18+
return new TestConnectionSettings(uris => new StaticConnectionPool(clusterNodes));
1719
}
1820

1921
public static IElasticClient GetOrAddClient<TConfig>(

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ protected virtual ConnectionSettings Authenticate(ConnectionSettings s) => s
4141
protected virtual ConnectionSettings ConnectionSettings(ConnectionSettings s) => s
4242
.ServerCertificateValidationCallback(CertificateValidations.AllowAll);
4343

44-
public virtual IElasticClient Client => this.GetOrAddClient(s=>this.Authenticate(this.ConnectionSettings(ConnectionSettingsExtensions.ApplyDomainSettings(s))));
44+
public virtual IElasticClient Client => this.GetOrAddClient(s=> this.Authenticate(this.ConnectionSettings(s.ApplyDomainSettings())));
4545

4646
protected override void SeedCluster() => new DefaultSeeder(this.Client).SeedNode();
4747
}

0 commit comments

Comments
 (0)