Skip to content

Commit 9132f1e

Browse files
committed
5.4.0 does not allow the same setting to be passed twice on the command line with the latter taking precedence, we now dedup the settings before starting a node when doing integration testing
1 parent b709391 commit 9132f1e

File tree

2 files changed

+6
-0
lines changed

2 files changed

+6
-0
lines changed

src/Tests/Framework/ManagedElasticsearch/Clusters/ClusterBase.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
using System;
2+
using System.Linq;
23
using Nest;
34
using Tests.Framework.Configuration;
45
using Tests.Framework.Integration;

src/Tests/Framework/ManagedElasticsearch/Nodes/NodeConfiguration.cs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,11 @@ public string[] CreateSettings(string[] additionalSettings)
8787
var settingMarker = this.ElasticsearchVersion.Major >= 5 ? "-E " : "-D";
8888
return DefaultNodeSettings
8989
.Concat(additionalSettings ?? Enumerable.Empty<string>())
90+
//allow additional settings to take precedence over already DefaultNodeSettings
91+
//without relying on elasticsearch to dedup, 5.4.0 no longer allows passing the same setting twice
92+
//on the command with the latter taking precedence
93+
.GroupBy(setting => setting.Split(new [] {'='}, 2, StringSplitOptions.RemoveEmptyEntries)[0])
94+
.Select(g => g.Last())
9095
.Select(s => $"{settingMarker}{s}")
9196
.ToArray();
9297
}

0 commit comments

Comments
 (0)