public void testOnModuleExceptionsArePropagated() {
   Settings settings = Settings.builder().put("path.home", createTempDir()).build();
   PluginsService service = newPluginsService(settings, FailOnModule.class);
   try {
     service.processModule(new BrokenModule());
     fail("boom");
   } catch (ElasticsearchException ex) {
     assertEquals("failed to invoke onModule", ex.getMessage());
     assertEquals("boom", ex.getCause().getCause().getMessage());
   }
 }