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

  SinkFactoryImpl snkfact = new SinkFactoryImpl();
  snkfact.setSink("failOpen", new SinkBuilder() {
    @Override
    public EventSink build(Context context, String... argv) {
      return new EventSink.Base() {
        @Override
        public void open() throws IOException {
          throw new IOException("open always fails");
        }
      };
    }
  });
  FlumeBuilder.setSinkFactory(snkfact);
  LogicalNode node = drive("asciisynth(10)", "failOpen");
  // Check that state is failed.
  assertEquals(DriverState.ERROR, node.getDriver().getState());
}