@@ -164,89 +164,6 @@ public void testRerouteIsNotCalledWhenNoNodesAreHotSpotting() {
164164 }
165165 }
166166
167- @ TestLogging (
168- value = "org.elasticsearch.cluster.routing.allocation.WriteLoadConstraintMonitor:DEBUG" ,
169- reason = "ensure we're skipping reroute for the right reason"
170- )
171- public void testRerouteIsNotCalledWhenNoNodeIsUnderUtilizationThreshold () {
172- final TestState testState = createRandomTestStateThatWillTriggerReroute ();
173-
174- // Transform the node usage stats so that all nodes are at the high-utilization threshold
175- final var nodeUsageStatsWithHighUtilization = Maps .transformValues (
176- testState .clusterInfo .getNodeUsageStatsForThreadPools (),
177- stats -> new NodeUsageStatsForThreadPools (
178- stats .nodeId (),
179- Maps .transformValues (
180- stats .threadPoolUsageStatsMap (),
181- tpStats -> new NodeUsageStatsForThreadPools .ThreadPoolUsageStats (
182- tpStats .totalThreadPoolThreads (),
183- (testState .highUtilizationThresholdPercent + 1 ) / 100f ,
184- tpStats .maxThreadPoolQueueLatencyMillis ()
185- )
186- )
187- )
188- );
189-
190- final WriteLoadConstraintMonitor writeLoadConstraintMonitor = new WriteLoadConstraintMonitor (
191- testState .clusterSettings ,
192- testState .currentTimeSupplier ,
193- () -> testState .clusterState ,
194- testState .mockRerouteService
195- );
196-
197- try (MockLog mockLog = MockLog .capture (WriteLoadConstraintMonitor .class )) {
198- mockLog .addExpectation (
199- new MockLog .SeenEventExpectation (
200- "don't reroute due to all nodes exceeding utilization threshold" ,
201- WriteLoadConstraintMonitor .class .getCanonicalName (),
202- Level .DEBUG ,
203- "No nodes are suitable as relocation targets"
204- )
205- );
206- writeLoadConstraintMonitor .onNewInfo (
207- ClusterInfo .builder ().nodeUsageStatsForThreadPools (nodeUsageStatsWithHighUtilization ).build ()
208- );
209- mockLog .assertAllExpectationsMatched ();
210- verifyNoInteractions (testState .mockRerouteService );
211- }
212- }
213-
214- @ TestLogging (
215- value = "org.elasticsearch.cluster.routing.allocation.WriteLoadConstraintMonitor:DEBUG" ,
216- reason = "ensure we're skipping reroute for the right reason"
217- )
218- public void testRerouteIsNotCalledWhenNoNodeIsUnderLatencyThreshold () {
219- final TestState testState = createRandomTestStateThatWillTriggerReroute ();
220-
221- final ClusterInfo clusterInfoWithAllNodesOverLatencyThreshold = createClusterInfoWithHotSpots (
222- testState .clusterState ,
223- testState .numberOfNodes ,
224- testState .latencyThresholdMillis ,
225- testState .highUtilizationThresholdPercent
226- );
227-
228- final WriteLoadConstraintMonitor writeLoadConstraintMonitor = new WriteLoadConstraintMonitor (
229- testState .clusterSettings ,
230- testState .currentTimeSupplier ,
231- () -> testState .clusterState ,
232- testState .mockRerouteService
233- );
234-
235- try (MockLog mockLog = MockLog .capture (WriteLoadConstraintMonitor .class )) {
236- mockLog .addExpectation (
237- new MockLog .SeenEventExpectation (
238- "don't reroute due to all nodes exceeding latency threshold" ,
239- WriteLoadConstraintMonitor .class .getCanonicalName (),
240- Level .DEBUG ,
241- "No nodes are suitable as relocation targets"
242- )
243- );
244- writeLoadConstraintMonitor .onNewInfo (clusterInfoWithAllNodesOverLatencyThreshold );
245- mockLog .assertAllExpectationsMatched ();
246- verifyNoInteractions (testState .mockRerouteService );
247- }
248- }
249-
250167 @ TestLogging (
251168 value = "org.elasticsearch.cluster.routing.allocation.WriteLoadConstraintMonitor:DEBUG" ,
252169 reason = "ensure we're skipping reroute for the right reason"
0 commit comments