@Test
void memoryUsageExceedLimitWithoutFastFailure() {

  when(memoryUsage.usage()).thenReturn(10L);
  when(randomFail.shouldFail()).thenReturn(false);
  assertThrows(ElasticsearchMemoryHealthy.MemoryUsageExceedException.class,
      () -> monitor.isMemoryHealthy(9L));
}