@Test
public void testFailCloseSource() throws IOException, RuntimeException,
    FlumeSpecException, InterruptedException {

  SourceFactoryImpl srcfact = new SourceFactoryImpl();
  srcfact.setSource("failClose", new SourceBuilder() {
    @Override
    public EventSource build(Context ctx, String... argv) {
      return new EventSource.Base() {
        @Override
        public void close() throws IOException {
          LOG.info("in FailOpenSource.close");
          throw new IOException("close always fails");
        }
      };
    }
  });
  FlumeBuilder.setSourceFactory(srcfact);
  LogicalNode node = drive("failClose", "null");
  // Check don't care if close throws exn
  assertEquals(DriverState.ERROR, node.getDriver().getState());
}