Program: 6724
Project: 6724
Buggy source:
@Test public void testAppWithPlugin() throws Exception {
  Id.Artifact artifactId=Id.Artifact.from(Id.Namespace.DEFAULT,"String_Node_Str","String_Node_Str");
  addAppArtifact(artifactId,AppWithPlugin.class);
  ArtifactRange artifactRange=new ArtifactRange(artifactId.getNamespace(),artifactId.getName(),artifactId.getVersion(),true,new ArtifactVersion("String_Node_Str"),true);
  Id.Artifact pluginArtifactId=Id.Artifact.from(Id.Namespace.DEFAULT,"String_Node_Str","String_Node_Str");
  addPluginArtifact(pluginArtifactId,Sets.<ArtifactRange>newHashSet(artifactRange),ToStringPlugin.class);
  Id.Application appId=Id.Application.from(Id.Namespace.DEFAULT,"String_Node_Str");
  CreateAppRequest createRequest=new CreateAppRequest(new ArtifactSummary(artifactId.getName(),artifactId.getVersion().getVersion(),false));
  ApplicationManager appManager=deployApplication(appId,createRequest);
  WorkerManager workerManager=appManager.getWorkerManager(AppWithPlugin.WORKER);
  workerManager.start();
  workerManager.waitForStatus(false,5,1);
  List<RunRecord> workerRun=workerManager.getHistory(ProgramRunStatus.COMPLETED);
  Assert.assertFalse(workerRun.isEmpty());
  ServiceManager serviceManager=appManager.getServiceManager(AppWithPlugin.SERVICE);
  serviceManager.start();
  serviceManager.waitForStatus(true,1,10);
  URL serviceURL=serviceManager.getServiceURL(5,TimeUnit.SECONDS);
  callServiceGet(serviceURL,"String_Node_Str");
  serviceManager.stop();
  serviceManager.waitForStatus(false,1,10);
  List<RunRecord> serviceRun=serviceManager.getHistory(ProgramRunStatus.KILLED);
  Assert.assertFalse(serviceRun.isEmpty());
  MapReduceManager mrManager=appManager.getMapReduceManager(AppWithPlugin.MAPREDUCE);
  mrManager.start();
  mrManager.waitForFinish(10,TimeUnit.MINUTES);
  List<RunRecord> runRecords=mrManager.getHistory();
  Assert.assertNotEquals(ProgramRunStatus.FAILED,runRecords.get(0).getStatus());
}

Fixed version (ground truth):
@Test public void testAppWithPlugin() throws Exception {
  Id.Artifact artifactId=Id.Artifact.from(Id.Namespace.DEFAULT,"String_Node_Str","String_Node_Str");
  addAppArtifact(artifactId,AppWithPlugin.class);
  ArtifactRange artifactRange=new ArtifactRange(artifactId.getNamespace(),artifactId.getName(),artifactId.getVersion(),true,new ArtifactVersion("String_Node_Str"),true);
  Id.Artifact pluginArtifactId=Id.Artifact.from(Id.Namespace.DEFAULT,"String_Node_Str","String_Node_Str");
  addPluginArtifact(pluginArtifactId,Sets.<ArtifactRange>newHashSet(artifactRange),ToStringPlugin.class);
  Id.Application appId=Id.Application.from(Id.Namespace.DEFAULT,"String_Node_Str");
  AppRequest createRequest=new AppRequest(new ArtifactSummary(artifactId.getName(),artifactId.getVersion().getVersion(),false));
  ApplicationManager appManager=deployApplication(appId,createRequest);
  WorkerManager workerManager=appManager.getWorkerManager(AppWithPlugin.WORKER);
  workerManager.start();
  workerManager.waitForStatus(false,5,1);
  List<RunRecord> workerRun=workerManager.getHistory(ProgramRunStatus.COMPLETED);
  Assert.assertFalse(workerRun.isEmpty());
  ServiceManager serviceManager=appManager.getServiceManager(AppWithPlugin.SERVICE);
  serviceManager.start();
  serviceManager.waitForStatus(true,1,10);
  URL serviceURL=serviceManager.getServiceURL(5,TimeUnit.SECONDS);
  callServiceGet(serviceURL,"String_Node_Str");
  serviceManager.stop();
  serviceManager.waitForStatus(false,1,10);
  List<RunRecord> serviceRun=serviceManager.getHistory(ProgramRunStatus.KILLED);
  Assert.assertFalse(serviceRun.isEmpty());
  MapReduceManager mrManager=appManager.getMapReduceManager(AppWithPlugin.MAPREDUCE);
  mrManager.start();
  mrManager.waitForFinish(10,TimeUnit.MINUTES);
  List<RunRecord> runRecords=mrManager.getHistory();
  Assert.assertNotEquals(ProgramRunStatus.FAILED,runRecords.get(0).getStatus());
}