From 71cfe1a874d550056d8b7facbc9b7acb04b92779 Mon Sep 17 00:00:00 2001 From: Christophe Bismuth Date: Thu, 4 Oct 2018 14:46:24 +0200 Subject: [PATCH] Test sequence of updates (#28309) --- .../allocation/DiskThresholdSettingsTests.java | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/server/src/test/java/org/elasticsearch/cluster/routing/allocation/DiskThresholdSettingsTests.java b/server/src/test/java/org/elasticsearch/cluster/routing/allocation/DiskThresholdSettingsTests.java index 342fcea7ddef1..89c7b6738178d 100644 --- a/server/src/test/java/org/elasticsearch/cluster/routing/allocation/DiskThresholdSettingsTests.java +++ b/server/src/test/java/org/elasticsearch/cluster/routing/allocation/DiskThresholdSettingsTests.java @@ -203,4 +203,20 @@ public void testInvalidHighDiskThreshold() { assertThat(cause, hasToString(containsString("low disk watermark [85%] more than high disk watermark [75%]"))); } + public void testSequenceOfUpdates() { + Settings settings = Settings.EMPTY; + + final ClusterSettings clusterSettings = new ClusterSettings(settings, ClusterSettings.BUILT_IN_CLUSTER_SETTINGS); + new DiskThresholdSettings(settings, clusterSettings); // this has the effect of registering the settings updater + + settings = clusterSettings.applySettings(Settings.builder() + .put(settings) + .put(DiskThresholdSettings.CLUSTER_ROUTING_ALLOCATION_DISK_FLOOD_STAGE_WATERMARK_SETTING.getKey(), "99%") + .build()); + settings = clusterSettings.applySettings(Settings.builder() + .put(settings) + .put(DiskThresholdSettings.CLUSTER_ROUTING_ALLOCATION_HIGH_DISK_WATERMARK_SETTING.getKey(), "97%") + .build()); + } + }