Program: 5689
Project: 5689
Buggy source:
@Test public void testLookup() throws Exception {
  addDatasetInstance(KeyValueTable.class.getName(),"String_Node_Str");
  DataSetManager<KeyValueTable> lookupTable=getDataset("String_Node_Str");
  lookupTable.get().write("String_Node_Str".getBytes(Charsets.UTF_8),"String_Node_Str".getBytes(Charsets.UTF_8));
  lookupTable.flush();
  File outDir=TMP_FOLDER.newFolder();
  ETLRealtimeConfig etlConfig=ETLRealtimeConfig.builder().addStage(new ETLStage("String_Node_Str",LookupSource.getPlugin(ImmutableSet.of("String_Node_Str","String_Node_Str"),"String_Node_Str"))).addStage(new ETLStage("String_Node_Str",MockSink.getPlugin(outDir))).addConnection("String_Node_Str","String_Node_Str").build();
  Id.Application appId=Id.Application.from(Id.Namespace.DEFAULT,"String_Node_Str");
  AppRequest<ETLRealtimeConfig> appRequest=new AppRequest<>(APP_ARTIFACT,etlConfig);
  ApplicationManager appManager=deployApplication(appId,appRequest);
  WorkerManager workerManager=appManager.getWorkerManager(ETLWorker.NAME);
  workerManager.start();
  workerManager.waitForStatus(true,10,1);
  Schema schema=Schema.recordOf("String_Node_Str",Schema.Field.of("String_Node_Str",Schema.nullableOf(Schema.of(Schema.Type.STRING))),Schema.Field.of("String_Node_Str",Schema.nullableOf(Schema.of(Schema.Type.STRING))));
  List<StructuredRecord> expected=new ArrayList<>();
  expected.add(StructuredRecord.builder(schema).set("String_Node_Str","String_Node_Str").build());
  try {
    List<StructuredRecord> actual=MockSink.getRecords(outDir,0,10,TimeUnit.SECONDS);
    Assert.assertEquals(expected,actual);
  }
  finally {
    stopWorker(workerManager);
  }
  validateMetric(1,appId,"String_Node_Str");
  validateMetric(1,appId,"String_Node_Str");
}

Fixed version (ground truth):
@Test public void testLookup() throws Exception {
  addDatasetInstance(KeyValueTable.class.getName(),"String_Node_Str");
  DataSetManager<KeyValueTable> lookupTable=getDataset("String_Node_Str");
  lookupTable.get().write("String_Node_Str".getBytes(Charsets.UTF_8),"String_Node_Str".getBytes(Charsets.UTF_8));
  lookupTable.flush();
  File outDir=TMP_FOLDER.newFolder();
  ETLRealtimeConfig etlConfig=ETLRealtimeConfig.builder().addStage(new ETLStage("String_Node_Str",LookupSource.getPlugin(ImmutableSet.of("String_Node_Str","String_Node_Str"),"String_Node_Str"))).addStage(new ETLStage("String_Node_Str",MockSink.getPlugin(outDir))).addConnection("String_Node_Str","String_Node_Str").build();
  ApplicationId appId=NamespaceId.DEFAULT.app("String_Node_Str");
  AppRequest<ETLRealtimeConfig> appRequest=new AppRequest<>(APP_ARTIFACT,etlConfig);
  ApplicationManager appManager=deployApplication(appId,appRequest);
  WorkerManager workerManager=appManager.getWorkerManager(ETLWorker.NAME);
  workerManager.start();
  workerManager.waitForStatus(true,10,1);
  Schema schema=Schema.recordOf("String_Node_Str",Schema.Field.of("String_Node_Str",Schema.nullableOf(Schema.of(Schema.Type.STRING))),Schema.Field.of("String_Node_Str",Schema.nullableOf(Schema.of(Schema.Type.STRING))));
  List<StructuredRecord> expected=new ArrayList<>();
  expected.add(StructuredRecord.builder(schema).set("String_Node_Str","String_Node_Str").build());
  try {
    List<StructuredRecord> actual=MockSink.getRecords(outDir,0,10,TimeUnit.SECONDS);
    Assert.assertEquals(expected,actual);
  }
  finally {
    stopWorker(workerManager);
  }
  validateMetric(1,appId,"String_Node_Str");
  validateMetric(1,appId,"String_Node_Str");
}