Skip to content

Commit f53ff20

Browse files
committed
healthIndicatorService.calculate doesn't work the way I thought
1 parent e2c05f7 commit f53ff20

File tree

1 file changed

+0
-6
lines changed

1 file changed

+0
-6
lines changed

server/src/test/java/org/elasticsearch/reservedstate/service/FileSettingsServiceTests.java

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -233,7 +233,6 @@ public void testInitialFileError() throws Exception {
233233
verify(fileSettingsService, times(1)).processFile(eq(watchedFile), eq(true));
234234
verify(controller, times(1)).process(any(), any(XContentParser.class), eq(ReservedStateVersionCheck.HIGHER_OR_SAME_VERSION), any());
235235

236-
assertEquals(YELLOW, healthIndicatorService.calculate(false, null).status());
237236
verify(healthIndicatorService, times(1)).changeOccurred();
238237
verify(healthIndicatorService, times(1)).failureOccurred(argThat(s -> s.startsWith(IllegalStateException.class.getName())));
239238
}
@@ -268,7 +267,6 @@ public void testInitialFileWorks() throws Exception {
268267
verify(fileSettingsService, times(1)).processFile(eq(watchedFile), eq(true));
269268
verify(controller, times(1)).process(any(), any(XContentParser.class), eq(ReservedStateVersionCheck.HIGHER_OR_SAME_VERSION), any());
270269

271-
assertEquals(GREEN, healthIndicatorService.calculate(false, null).status());
272270
verify(healthIndicatorService, times(1)).changeOccurred();
273271
verify(healthIndicatorService, times(1)).successOccurred();
274272
}
@@ -323,7 +321,6 @@ public void testProcessFileChanges() throws Exception {
323321
verify(fileSettingsService, times(1)).processFile(eq(watchedFile), eq(false));
324322
verify(controller, times(1)).process(any(), any(XContentParser.class), eq(ReservedStateVersionCheck.HIGHER_VERSION_ONLY), any());
325323

326-
assertEquals(GREEN, healthIndicatorService.calculate(false, null).status());
327324
verify(healthIndicatorService, times(2)).changeOccurred();
328325
verify(healthIndicatorService, times(2)).successOccurred();
329326
}
@@ -367,7 +364,6 @@ public void testInvalidJSON() throws Exception {
367364
argThat(e -> unwrapException(e) instanceof XContentParseException)
368365
);
369366

370-
assertEquals(YELLOW, healthIndicatorService.calculate(false, null).status());
371367
verify(healthIndicatorService, Mockito.atLeast(1)).failureOccurred(contains(XContentParseException.class.getName()));
372368
}
373369

@@ -433,8 +429,6 @@ public void testStopWorksInMiddleOfProcessing() throws Exception {
433429
assertFalse(fileSettingsService.watching());
434430
fileSettingsService.close();
435431

436-
// When the service is stopped, the health indicator should be green
437-
assertEquals(GREEN, healthIndicatorService.calculate(false, null).status());
438432
verify(healthIndicatorService).stopOccurred();
439433

440434
// let the deadlocked thread end, so we can cleanly exit the test

0 commit comments

Comments
 (0)