Program: 55328
Project: 55328
Buggy source:
/** 
 * Tests the execution of a job with a large degree of parallelism. In particular, the tests checks that the overall runtime of the test does not exceed a certain time limit.
 */
@Test public void testExecutionWithLargeDoP(){
  final int numberOfSubtasks=64;
  File inputFile1=null;
  File inputFile2=null;
  File outputFile=null;
  File jarFile=new File(ServerTestUtils.getTempDir() + File.separator + "String_Node_Str");
  JobClient jobClient=null;
  try {
    inputFile1=ServerTestUtils.createInputFile(0);
    inputFile2=ServerTestUtils.createInputFile(0);
    outputFile=new File(ServerTestUtils.getTempDir() + File.separator + ServerTestUtils.getRandomFilename());
    JarFileCreator jfc=new JarFileCreator(jarFile);
    jfc.addClass(UnionTask.class);
    jfc.createJarFile();
    final JobGraph jg=new JobGraph("String_Node_Str" + numberOfSubtasks + "String_Node_Str");
    final JobFileInputVertex i1=new JobFileInputVertex("String_Node_Str",jg);
    i1.setFileInputClass(FileLineReader.class);
    i1.setFilePath(new Path(inputFile1.toURI()));
    i1.setNumberOfSubtasks(numberOfSubtasks);
    i1.setNumberOfSubtasksPerInstance(numberOfSubtasks);
    final JobFileInputVertex i2=new JobFileInputVertex("String_Node_Str",jg);
    i2.setFileInputClass(FileLineReader.class);
    i2.setFilePath(new Path(inputFile2.toURI()));
    i2.setNumberOfSubtasks(numberOfSubtasks);
    i2.setNumberOfSubtasksPerInstance(numberOfSubtasks);
    final JobTaskVertex f1=new JobTaskVertex("String_Node_Str",jg);
    f1.setTaskClass(DoubleTargetTask.class);
    f1.setNumberOfSubtasks(numberOfSubtasks);
    f1.setNumberOfSubtasksPerInstance(numberOfSubtasks);
    JobFileOutputVertex o1=new JobFileOutputVertex("String_Node_Str",jg);
    o1.setFileOutputClass(FileLineWriter.class);
    o1.setFilePath(new Path(outputFile.toURI()));
    o1.setNumberOfSubtasks(numberOfSubtasks);
    o1.setNumberOfSubtasksPerInstance(numberOfSubtasks);
    i1.setVertexToShareInstancesWith(o1);
    i2.setVertexToShareInstancesWith(o1);
    f1.setVertexToShareInstancesWith(o1);
    i1.connectTo(f1,ChannelType.NETWORK,CompressionLevel.NO_COMPRESSION,DistributionPattern.BIPARTITE);
    i2.connectTo(f1,ChannelType.NETWORK,CompressionLevel.NO_COMPRESSION,DistributionPattern.BIPARTITE);
    f1.connectTo(o1,ChannelType.NETWORK,CompressionLevel.NO_COMPRESSION,DistributionPattern.BIPARTITE);
    jg.addJar(new Path(jarFile.toURI()));
    jobClient=new JobClient(jg,configuration);
    try {
      jobClient.submitJobAndWait();
    }
 catch (    JobExecutionException e) {
      return;
    }
    fail("String_Node_Str");
  }
 catch (  JobGraphDefinitionException jgde) {
    fail(jgde.getMessage());
  }
catch (  IOException ioe) {
    fail(ioe.getMessage());
  }
 finally {
    if (inputFile1 != null) {
      inputFile1.delete();
    }
    if (inputFile2 != null) {
      inputFile2.delete();
    }
    if (outputFile != null) {
      if (outputFile.isDirectory()) {
        final String[] files=outputFile.list();
        final String outputDir=outputFile.getAbsolutePath();
        for (        final String file : files) {
          new File(outputDir + File.separator + file).delete();
        }
      }
      outputFile.delete();
    }
    if (jarFile != null) {
      jarFile.delete();
    }
    if (jobClient != null) {
      jobClient.close();
    }
  }
}

Fixed version (ground truth):
/** 
 * Tests the execution of a job with a large degree of parallelism. In particular, the tests checks that the overall runtime of the test does not exceed a certain time limit.
 */
@Test public void testExecutionWithLargeDoP(){
  final int numberOfSubtasks=64;
  File inputFile1=null;
  File inputFile2=null;
  File outputFile=null;
  File jarFile=new File(ServerTestUtils.getTempDir() + File.separator + "String_Node_Str");
  JobClient jobClient=null;
  try {
    inputFile1=ServerTestUtils.createInputFile(0);
    inputFile2=ServerTestUtils.createInputFile(0);
    outputFile=new File(ServerTestUtils.getTempDir() + File.separator + ServerTestUtils.getRandomFilename());
    JarFileCreator jfc=new JarFileCreator(jarFile);
    jfc.addClass(UnionTask.class);
    jfc.createJarFile();
    final JobGraph jg=new JobGraph("String_Node_Str" + numberOfSubtasks + "String_Node_Str");
    final JobFileInputVertex i1=new JobFileInputVertex("String_Node_Str",jg);
    i1.setFileInputClass(FileLineReader.class);
    i1.setFilePath(new Path(inputFile1.toURI()));
    i1.setNumberOfSubtasks(numberOfSubtasks);
    i1.setNumberOfSubtasksPerInstance(numberOfSubtasks);
    i1.setNumberOfExecutionRetries(1);
    final JobFileInputVertex i2=new JobFileInputVertex("String_Node_Str",jg);
    i2.setFileInputClass(FileLineReader.class);
    i2.setFilePath(new Path(inputFile2.toURI()));
    i2.setNumberOfSubtasks(numberOfSubtasks);
    i2.setNumberOfSubtasksPerInstance(numberOfSubtasks);
    i2.setNumberOfExecutionRetries(1);
    final JobTaskVertex f1=new JobTaskVertex("String_Node_Str",jg);
    f1.setTaskClass(DoubleTargetTask.class);
    f1.setNumberOfSubtasks(numberOfSubtasks);
    f1.setNumberOfSubtasksPerInstance(numberOfSubtasks);
    f1.setNumberOfExecutionRetries(1);
    JobFileOutputVertex o1=new JobFileOutputVertex("String_Node_Str",jg);
    o1.setFileOutputClass(FileLineWriter.class);
    o1.setFilePath(new Path(outputFile.toURI()));
    o1.setNumberOfSubtasks(numberOfSubtasks);
    o1.setNumberOfSubtasksPerInstance(numberOfSubtasks);
    o1.setNumberOfExecutionRetries(1);
    i1.setVertexToShareInstancesWith(o1);
    i2.setVertexToShareInstancesWith(o1);
    f1.setVertexToShareInstancesWith(o1);
    i1.connectTo(f1,ChannelType.NETWORK,CompressionLevel.NO_COMPRESSION,DistributionPattern.BIPARTITE);
    i2.connectTo(f1,ChannelType.NETWORK,CompressionLevel.NO_COMPRESSION,DistributionPattern.BIPARTITE);
    f1.connectTo(o1,ChannelType.NETWORK,CompressionLevel.NO_COMPRESSION,DistributionPattern.BIPARTITE);
    jg.addJar(new Path(jarFile.toURI()));
    jobClient=new JobClient(jg,configuration);
    try {
      jobClient.submitJobAndWait();
    }
 catch (    JobExecutionException e) {
      return;
    }
    fail("String_Node_Str");
  }
 catch (  JobGraphDefinitionException jgde) {
    fail(jgde.getMessage());
  }
catch (  IOException ioe) {
    fail(ioe.getMessage());
  }
 finally {
    if (inputFile1 != null) {
      inputFile1.delete();
    }
    if (inputFile2 != null) {
      inputFile2.delete();
    }
    if (outputFile != null) {
      if (outputFile.isDirectory()) {
        final String[] files=outputFile.list();
        final String outputDir=outputFile.getAbsolutePath();
        for (        final String file : files) {
          new File(outputDir + File.separator + file).delete();
        }
      }
      outputFile.delete();
    }
    if (jarFile != null) {
      jarFile.delete();
    }
    if (jobClient != null) {
      jobClient.close();
    }
  }
}