Program: 8029
Project: 8029
Buggy source:
@Test public void testApp() throws InterruptedException, IOException, TimeoutException, OperationException {
  ApplicationManager applicationManager=deployApplication(WordCountApp2.class);
  try {
    applicationManager.startFlow("String_Node_Str");
    StreamWriter streamWriter=applicationManager.getStreamWriter("String_Node_Str");
    for (int i=0; i < 100; i++) {
      streamWriter.send(ImmutableMap.of("String_Node_Str","String_Node_Str" + i),"String_Node_Str" + i);
    }
    RuntimeMetrics flowletMetrics=RuntimeStats.getFlowletMetrics("String_Node_Str","String_Node_Str","String_Node_Str");
    flowletMetrics.waitForProcessed(500,5,TimeUnit.SECONDS);
    Assert.assertEquals(0L,flowletMetrics.getException());
    ProcedureManager procedureManager=applicationManager.startProcedure("String_Node_Str");
    ProcedureClient procedureClient=procedureManager.getClient();
    Type resultType=new TypeToken<Map<String,Long>>(){
    }
.getType();
    Gson gson=new Gson();
    Map<String,Long> result=gson.fromJson(procedureClient.query("String_Node_Str",ImmutableMap.of("String_Node_Str","String_Node_Str")),resultType);
    Assert.assertEquals(100L,result.get("String_Node_Str").longValue());
    KeyValueTable mydataset=applicationManager.getDataSet("String_Node_Str");
    Assert.assertEquals(100L,Longs.fromByteArray(mydataset.read("String_Node_Str".getBytes(Charsets.UTF_8))));
    RuntimeMetrics procedureMetrics=RuntimeStats.getProcedureMetrics("String_Node_Str","String_Node_Str");
    procedureMetrics.waitForProcessed(1,1,TimeUnit.SECONDS);
    Assert.assertEquals(0L,procedureMetrics.getException());
  }
  finally {
    applicationManager.stopAll();
  }
}

Fixed version (ground truth):
@Test public void testApp() throws InterruptedException, IOException, TimeoutException, OperationException {
  ApplicationManager applicationManager=deployApplication(WordCountApp2.class);
  try {
    applicationManager.startFlow("String_Node_Str");
    StreamWriter streamWriter=applicationManager.getStreamWriter("String_Node_Str");
    for (int i=0; i < 100; i++) {
      streamWriter.send(ImmutableMap.of("String_Node_Str","String_Node_Str" + i),"String_Node_Str" + i);
    }
    RuntimeMetrics flowletMetrics=RuntimeStats.getFlowletMetrics("String_Node_Str","String_Node_Str","String_Node_Str");
    flowletMetrics.waitForProcessed(500,5,TimeUnit.SECONDS);
    Assert.assertEquals(0L,flowletMetrics.getException());
    ProcedureManager procedureManager=applicationManager.startProcedure("String_Node_Str");
    ProcedureClient procedureClient=procedureManager.getClient();
    Type resultType=new TypeToken<Map<String,Long>>(){
    }
.getType();
    Gson gson=new Gson();
    Map<String,Long> result=gson.fromJson(procedureClient.query("String_Node_Str",ImmutableMap.of("String_Node_Str","String_Node_Str")),resultType);
    Assert.assertEquals(100L,result.get("String_Node_Str").longValue());
    MyKeyValueTable mydataset=applicationManager.getDataSet("String_Node_Str");
    Assert.assertEquals(100L,Longs.fromByteArray(mydataset.read("String_Node_Str".getBytes(Charsets.UTF_8))));
    RuntimeMetrics procedureMetrics=RuntimeStats.getProcedureMetrics("String_Node_Str","String_Node_Str");
    procedureMetrics.waitForProcessed(1,1,TimeUnit.SECONDS);
    Assert.assertEquals(0L,procedureMetrics.getException());
  }
  finally {
    applicationManager.stopAll();
  }
}