Program: 7913
Project: 7913
Buggy source:
public void testApp(){
  ApplicationManager bam=deployApplication(appClass);
  LOG.info("String_Node_Str");
  MensaMetricsReporter mmr=new MensaMetricsReporter("String_Node_Str",4242,ImmutableList.of("String_Node_Str"),"String_Node_Str",10);
  try {
    LOG.info("String_Node_Str");
    FlowManager flowMgr=bam.startFlow(flowName);
    LOG.info("String_Node_Str");
    StreamWriter kvStream=bam.getStreamWriter("String_Node_Str");
    for (int i=0; i < 40000; i++) {
      kvStream.send("String_Node_Str" + i + "String_Node_Str"+ "String_Node_Str"+ i);
    }
    Map<String,Double> allCounters=BenchmarkRuntimeStats.getCounters(appName,flowName);
    BenchmarkRuntimeMetrics sourceMetrics=BenchmarkRuntimeStats.getFlowletMetrics(appName,flowName,"String_Node_Str");
    logProcessed();
    try {
      sourceMetrics.waitForProcessed(10000,30,TimeUnit.SECONDS);
    }
 catch (    TimeoutException te) {
      LOG.warn("String_Node_Str");
    }
    logProcessed();
    Counter meanReadRate=BenchmarkRuntimeStats.getCounter(appName,flowName,"String_Node_Str","String_Node_Str");
    Map<String,Double> sourceCounters=BenchmarkRuntimeStats.getCounters(appName,flowName,"String_Node_Str");
    Map<String,Double> writerCounters=BenchmarkRuntimeStats.getCounters(appName,flowName,"String_Node_Str");
    Map<String,Double> readerCounters=BenchmarkRuntimeStats.getCounters(appName,flowName,"String_Node_Str");
    BenchmarkRuntimeMetrics readerMetrics=BenchmarkRuntimeStats.getFlowletMetrics(appName,flowName,"String_Node_Str");
    logProcessed();
    readerMetrics.waitForProcessed(10000,30,TimeUnit.SECONDS);
    logProcessed();
    Counter datasetStorageWordCountsCount=BenchmarkRuntimeStats.getCounter("String_Node_Str");
    mmr.reportNow("String_Node_Str",1000.0);
  }
 catch (  Exception e) {
    throw new RuntimeException(e);
  }
 finally {
    LOG.info("String_Node_Str");
    mmr.shutdown();
  }
}

Fixed version (ground truth):
public void testApp(){
  LOG.info("String_Node_Str");
  clearAppFabric();
  LOG.info("String_Node_Str",appName);
  ApplicationManager bam=deployApplication(appClass);
  LOG.info("String_Node_Str");
  MensaMetricsReporter mmr=new MensaMetricsReporter("String_Node_Str",4242,ImmutableList.of("String_Node_Str"),"String_Node_Str",10);
  try {
    LOG.info("String_Node_Str",flowName);
    FlowManager flowMgr=bam.startFlow(flowName);
    LOG.info("String_Node_Str");
    StreamWriter kvStream=bam.getStreamWriter("String_Node_Str");
    for (int i=0; i < 40000; i++) {
      kvStream.send("String_Node_Str" + i + "String_Node_Str"+ "String_Node_Str"+ i);
    }
    Map<String,Double> allCounters=BenchmarkRuntimeStats.getCounters(appName,flowName);
    BenchmarkRuntimeMetrics sourceMetrics=BenchmarkRuntimeStats.getFlowletMetrics(appName,flowName,"String_Node_Str");
    logProcessed();
    try {
      sourceMetrics.waitForProcessed(10000,30,TimeUnit.SECONDS);
    }
 catch (    TimeoutException te) {
      LOG.warn("String_Node_Str");
    }
    logProcessed();
    BenchmarkRuntimeMetrics readerMetrics=BenchmarkRuntimeStats.getFlowletMetrics(appName,flowName,"String_Node_Str");
    logProcessed();
    readerMetrics.waitForProcessed(10000,30,TimeUnit.SECONDS);
    logProcessed();
    mmr.reportNow("String_Node_Str",1000.0);
  }
 catch (  Exception e) {
    throw new RuntimeException(e);
  }
 finally {
    LOG.info("String_Node_Str");
    mmr.shutdown();
    LOG.info("String_Node_Str");
    bam.stopAll();
    LOG.info("String_Node_Str");
    clearAppFabric();
  }
}