Program: 6688
Project: 6688
Buggy source:
@Test public void testFlowLineage() throws Exception {
  String namespace="String_Node_Str";
  Id.Application app=Id.Application.from(namespace,AllProgramsApp.NAME);
  Id.Flow flow=Id.Flow.from(app,AllProgramsApp.NoOpFlow.NAME);
  Id.DatasetInstance dataset=Id.DatasetInstance.from(namespace,AllProgramsApp.DATASET_NAME);
  Id.Stream stream=Id.Stream.from(namespace,AllProgramsApp.STREAM_NAME);
  Assert.assertEquals(200,status(createNamespace(namespace)));
  try {
    Assert.assertEquals(200,status(deploy(AllProgramsApp.class,Constants.Gateway.API_VERSION_3_TOKEN,namespace)));
    ImmutableMap<String,String> appProperties=ImmutableMap.of("String_Node_Str","String_Node_Str");
    Assert.assertEquals(200,addProperties(app,appProperties).getResponseCode());
    Assert.assertEquals(appProperties,getProperties(app));
    ImmutableSet<String> appTags=ImmutableSet.of("String_Node_Str");
    Assert.assertEquals(200,addTags(app,appTags).getResponseCode());
    Assert.assertEquals(appTags,getTags(app));
    ImmutableMap<String,String> flowProperties=ImmutableMap.of("String_Node_Str","String_Node_Str");
    Assert.assertEquals(200,addProperties(flow,flowProperties).getResponseCode());
    Assert.assertEquals(flowProperties,getProperties(flow));
    ImmutableSet<String> flowTags=ImmutableSet.of("String_Node_Str","String_Node_Str");
    Assert.assertEquals(200,addTags(flow,flowTags).getResponseCode());
    Assert.assertEquals(flowTags,getTags(flow));
    ImmutableMap<String,String> dataProperties=ImmutableMap.of("String_Node_Str","String_Node_Str");
    Assert.assertEquals(200,addProperties(dataset,dataProperties).getResponseCode());
    Assert.assertEquals(dataProperties,getProperties(dataset));
    ImmutableSet<String> dataTags=ImmutableSet.of("String_Node_Str","String_Node_Str");
    Assert.assertEquals(200,addTags(dataset,dataTags).getResponseCode());
    Assert.assertEquals(dataTags,getTags(dataset));
    ImmutableMap<String,String> streamProperties=ImmutableMap.of("String_Node_Str","String_Node_Str");
    Assert.assertEquals(200,addProperties(stream,streamProperties).getResponseCode());
    Assert.assertEquals(streamProperties,getProperties(stream));
    ImmutableSet<String> streamTags=ImmutableSet.of("String_Node_Str","String_Node_Str");
    Assert.assertEquals(200,addTags(stream,streamTags).getResponseCode());
    Assert.assertEquals(streamTags,getTags(stream));
    RunId flowRunId=runAndWait(flow);
    waitForStop(flow,true);
    long now=System.currentTimeMillis();
    long oneHourMillis=TimeUnit.HOURS.toMillis(1);
    HttpResponse httpResponse=fetchLineage(dataset,now - oneHourMillis,now + oneHourMillis,10);
    Assert.assertEquals(200,httpResponse.getResponseCode());
    LineageRecord lineage=GSON.fromJson(httpResponse.getResponseBodyAsString(),LineageRecord.class);
    LineageRecord expected=new LineageRecord(now - oneHourMillis,now + oneHourMillis,ImmutableSet.of(new Relation(dataset,flow,AccessType.UNKNOWN,ImmutableSet.of(flowRunId),ImmutableSet.of(Id.Flow.Flowlet.from(flow,AllProgramsApp.A.NAME))),new Relation(stream,flow,AccessType.READ,ImmutableSet.of(flowRunId),ImmutableSet.of(Id.Flow.Flowlet.from(flow,AllProgramsApp.A.NAME)))));
    Assert.assertEquals(expected,lineage);
    httpResponse=fetchLineage(stream,now - oneHourMillis,now + oneHourMillis,10);
    Assert.assertEquals(200,httpResponse.getResponseCode());
    lineage=GSON.fromJson(httpResponse.getResponseBodyAsString(),LineageRecord.class);
    Assert.assertEquals(expected,lineage);
    Id.Program programForFlow=Id.Program.from(flow.getApplication(),flow.getType(),flow.getId());
    Assert.assertEquals(toSet(new MetadataRecord(app,appProperties,appTags),new MetadataRecord(programForFlow,flowProperties,flowTags),new MetadataRecord(dataset,dataProperties,dataTags),new MetadataRecord(stream,streamProperties,streamTags)),fetchAccesses(new Id.Run(flow,flowRunId.getId())));
  }
  finally {
    try {
      deleteNamespace(namespace);
    }
 catch (    Throwable e) {
      LOG.error("String_Node_Str",namespace,e);
    }
  }
}

Fixed version (ground truth):
@Test public void testFlowLineage() throws Exception {
  String namespace="String_Node_Str";
  Id.Application app=Id.Application.from(namespace,AllProgramsApp.NAME);
  Id.Flow flow=Id.Flow.from(app,AllProgramsApp.NoOpFlow.NAME);
  Id.DatasetInstance dataset=Id.DatasetInstance.from(namespace,AllProgramsApp.DATASET_NAME);
  Id.Stream stream=Id.Stream.from(namespace,AllProgramsApp.STREAM_NAME);
  Assert.assertEquals(200,status(createNamespace(namespace)));
  try {
    Assert.assertEquals(200,status(deploy(AllProgramsApp.class,Constants.Gateway.API_VERSION_3_TOKEN,namespace)));
    ImmutableMap<String,String> appProperties=ImmutableMap.of("String_Node_Str","String_Node_Str");
    Assert.assertEquals(200,addProperties(app,appProperties).getResponseCode());
    Assert.assertEquals(appProperties,getProperties(app));
    ImmutableSet<String> appTags=ImmutableSet.of("String_Node_Str");
    Assert.assertEquals(200,addTags(app,appTags).getResponseCode());
    Assert.assertEquals(appTags,getTags(app));
    ImmutableMap<String,String> flowProperties=ImmutableMap.of("String_Node_Str","String_Node_Str");
    Assert.assertEquals(200,addProperties(flow,flowProperties).getResponseCode());
    Assert.assertEquals(flowProperties,getProperties(flow));
    ImmutableSet<String> flowTags=ImmutableSet.of("String_Node_Str","String_Node_Str");
    Assert.assertEquals(200,addTags(flow,flowTags).getResponseCode());
    Assert.assertEquals(flowTags,getTags(flow));
    ImmutableMap<String,String> dataProperties=ImmutableMap.of("String_Node_Str","String_Node_Str");
    Assert.assertEquals(200,addProperties(dataset,dataProperties).getResponseCode());
    Assert.assertEquals(dataProperties,getProperties(dataset));
    ImmutableSet<String> dataTags=ImmutableSet.of("String_Node_Str","String_Node_Str");
    Assert.assertEquals(200,addTags(dataset,dataTags).getResponseCode());
    Assert.assertEquals(dataTags,getTags(dataset));
    ImmutableMap<String,String> streamProperties=ImmutableMap.of("String_Node_Str","String_Node_Str");
    Assert.assertEquals(200,addProperties(stream,streamProperties).getResponseCode());
    Assert.assertEquals(streamProperties,getProperties(stream));
    ImmutableSet<String> streamTags=ImmutableSet.of("String_Node_Str","String_Node_Str");
    Assert.assertEquals(200,addTags(stream,streamTags).getResponseCode());
    Assert.assertEquals(streamTags,getTags(stream));
    RunId flowRunId=runAndWait(flow);
    waitForStop(flow,true);
    long now=System.currentTimeMillis();
    long oneHourMillis=TimeUnit.HOURS.toMillis(1);
    HttpResponse httpResponse=fetchLineage(dataset,now - oneHourMillis,now + oneHourMillis,10);
    Assert.assertEquals(200,httpResponse.getResponseCode());
    LineageRecord lineage=GSON.fromJson(httpResponse.getResponseBodyAsString(),LineageRecord.class);
    LineageRecord expected=new LineageRecord(now - oneHourMillis,now + oneHourMillis,ImmutableSet.of(new Relation(dataset,flow,AccessType.UNKNOWN,ImmutableSet.of(flowRunId),ImmutableSet.of(Id.Flow.Flowlet.from(flow,AllProgramsApp.A.NAME))),new Relation(stream,flow,AccessType.READ,ImmutableSet.of(flowRunId),ImmutableSet.of(Id.Flow.Flowlet.from(flow,AllProgramsApp.A.NAME)))));
    Assert.assertEquals(expected,lineage);
    httpResponse=fetchLineage(stream,now - oneHourMillis,now + oneHourMillis,10);
    Assert.assertEquals(200,httpResponse.getResponseCode());
    lineage=GSON.fromJson(httpResponse.getResponseBodyAsString(),LineageRecord.class);
    Assert.assertEquals(expected,lineage);
    Id.Program programForFlow=Id.Program.from(flow.getApplication(),flow.getType(),flow.getId());
    Assert.assertEquals(toSet(new MetadataRecord(app,appProperties,appTags),new MetadataRecord(programForFlow,flowProperties,flowTags),new MetadataRecord(dataset,dataProperties,dataTags),new MetadataRecord(stream,streamProperties,streamTags)),fetchRunMetadata(new Id.Run(flow,flowRunId.getId())));
  }
  finally {
    try {
      deleteNamespace(namespace);
    }
 catch (    Throwable e) {
      LOG.error("String_Node_Str",namespace,e);
    }
  }
}