From 19be61565ca91770fea6778cc4f0bd87a158aaf4 Mon Sep 17 00:00:00 2001 From: Ryan Ernst Date: Mon, 23 Oct 2023 09:50:55 -0700 Subject: [PATCH] normalize default node name --- .../elasticsearch/gradle/testclusters/ElasticsearchNode.java | 5 ++--- .../resources/rest-api-spec/test/nodes.info/30_settings.yml | 4 ++-- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/build-tools/src/main/java/org/elasticsearch/gradle/testclusters/ElasticsearchNode.java b/build-tools/src/main/java/org/elasticsearch/gradle/testclusters/ElasticsearchNode.java index f0ab67fe51a3..6aa830525951 100644 --- a/build-tools/src/main/java/org/elasticsearch/gradle/testclusters/ElasticsearchNode.java +++ b/build-tools/src/main/java/org/elasticsearch/gradle/testclusters/ElasticsearchNode.java @@ -125,8 +125,7 @@ public class ElasticsearchNode implements TestClusterConfiguration { "is a pre-release version of Elasticsearch", "max virtual memory areas vm.max_map_count" ); - private static final String HOSTNAME_OVERRIDE = "LinuxDarwinHostname"; - private static final String COMPUTERNAME_OVERRIDE = "WindowsComputername"; + private static final String HOSTNAME_OVERRIDE = "NodeHostname"; private final String path; private final String name; @@ -907,7 +906,7 @@ private Map getESEnvironment() { // Override the system hostname variables for testing defaultEnv.put("HOSTNAME", HOSTNAME_OVERRIDE); - defaultEnv.put("COMPUTERNAME", COMPUTERNAME_OVERRIDE); + defaultEnv.put("COMPUTERNAME", HOSTNAME_OVERRIDE); Set commonKeys = new HashSet<>(environment.keySet()); commonKeys.retainAll(defaultEnv.keySet()); diff --git a/rest-api-spec/src/yamlRestTest/resources/rest-api-spec/test/nodes.info/30_settings.yml b/rest-api-spec/src/yamlRestTest/resources/rest-api-spec/test/nodes.info/30_settings.yml index 14ec14bb3f23..52a0751cfb73 100644 --- a/rest-api-spec/src/yamlRestTest/resources/rest-api-spec/test/nodes.info/30_settings.yml +++ b/rest-api-spec/src/yamlRestTest/resources/rest-api-spec/test/nodes.info/30_settings.yml @@ -12,11 +12,11 @@ nodes.info: metric: [ settings ] - - match : { nodes.$node_id.settings.node.name: node } + - match : { nodes.$node_id.settings.node.roles: NodeHostname } - do: nodes.info: metric: [ settings ] flat_settings: true - - match : { nodes.$node_id.settings.node\.name: node } + - match : { nodes.$node_id.settings.node\.name: NodeHostname }