// run a job which gets stuck in mapper and kill it. /// <exception cref="System.Exception"/> private void TestKilledJob(string fileName, Type output, string[] exclude) { Path outDir = GetNewOutputDir(); Job job = MapReduceTestUtil.CreateKillJob(conf, outDir, inDir); job.SetOutputFormatClass(output); job.Submit(); // wait for the setup to be completed while (job.SetupProgress() != 1.0f) { UtilsForTests.WaitFor(100); } job.KillJob(); // kill the job NUnit.Framework.Assert.IsFalse("Job did not get kill", job.WaitForCompletion(true )); if (fileName != null) { Path testFile = new Path(outDir, fileName); NUnit.Framework.Assert.IsTrue("File " + testFile + " missing for job " + job.GetJobID (), fs.Exists(testFile)); } // check if the files from the missing set exists foreach (string ex in exclude) { Path file = new Path(outDir, ex); NUnit.Framework.Assert.IsFalse("File " + file + " should not be present for killed job " + job.GetJobID(), fs.Exists(file)); } }