Exemple #1
0
        public virtual void TestMultipleFailedTasks()
        {
            JobHistoryParser parser = new JobHistoryParser(Org.Mockito.Mockito.Mock <FSDataInputStream
                                                                                     >());
            EventReader   reader        = Org.Mockito.Mockito.Mock <EventReader>();
            AtomicInteger numEventsRead = new AtomicInteger(0);
            // Hack!
            TaskType taskType = TaskType.Map;

            TaskID[] tids = new TaskID[2];
            JobID    jid  = new JobID("1", 1);

            tids[0] = new TaskID(jid, taskType, 0);
            tids[1] = new TaskID(jid, taskType, 1);
            Org.Mockito.Mockito.When(reader.GetNextEvent()).ThenAnswer(new _Answer_842(numEventsRead
                                                                                       , tids, taskType, jid));
            // send two task start and two task fail events for tasks 0 and 1
            JobHistoryParser.JobInfo info = parser.Parse(reader);
            NUnit.Framework.Assert.IsTrue("Task 0 not implicated", info.GetErrorInfo().Contains
                                              (tids[0].ToString()));
        }
Exemple #2
0
 public virtual IList <string> GetDiagnostics()
 {
     return(Sharpen.Collections.SingletonList(jobInfo.GetErrorInfo()));
 }
Exemple #3
0
        public virtual void TestFailedJobHistoryWithoutDiagnostics()
        {
            Path histPath = new Path(GetType().GetClassLoader().GetResource("job_1393307629410_0001-1393307687476-user-Sleep+job-1393307723835-0-0-FAILED-default-1393307693920.jhist"
                                                                            ).GetFile());
            FileSystem        lfs   = FileSystem.GetLocal(new Configuration());
            FSDataInputStream fsdis = lfs.Open(histPath);

            try
            {
                JobHistoryParser         parser = new JobHistoryParser(fsdis);
                JobHistoryParser.JobInfo info   = parser.Parse();
                NUnit.Framework.Assert.AreEqual("History parsed jobId incorrectly", info.GetJobId
                                                    (), JobID.ForName("job_1393307629410_0001"));
                NUnit.Framework.Assert.AreEqual("Default diagnostics incorrect ", string.Empty, info
                                                .GetErrorInfo());
            }
            finally
            {
                fsdis.Close();
            }
        }