示例#1
0
 def test_running_job_status(self):
     _stderr = os.path.join(os.path.dirname(__file__), 'resources',
                            'mapreduce', 'running_job_status')
     with open(_stderr) as _file:
         job = JobStatus("test_job")
         job._parse_stdout_(stream="\n".join(_file.readlines()))
         self.assertTrue(job.is_running())
         # some counters may be available for running job
         self.assertEqual(1, len(job.counters()), "Error : injected stdout contain 1 counter group")
示例#2
0
 def test_running_job_status(self):
     _stderr = os.path.join(os.path.dirname(__file__), 'resources',
                            'mapreduce', 'running_job_status')
     with open(_stderr) as _file:
         job = JobStatus("test_job")
         job._parse_stdout_(stream="\n".join(_file.readlines()))
         self.assertTrue(job.is_running())
         # some counters may be available for running job
         self.assertEqual(
             1, len(job.counters()),
             "Error : injected stdout contain 1 counter group")
示例#3
0
 def test_failed_job_status(self):
     _stderr = os.path.join(os.path.dirname(__file__), 'resources',
                            'mapreduce', 'failed_job_status')
     with open(_stderr) as _file:
         job = JobStatus("test_job")
         job._parse_stdout_(stream="\n".join(_file.readlines()))
         self.assertFalse(job.is_running())
         self.assertTrue(job.is_failed())
         self.assertEqual(
             'task 1412153770896_0092_m_000000 failed 9 times '
             'For details check tasktracker at: vm-cluster-node4:8041',
             job.failure_reason())
         self.assertEqual(0, len(job.counters()), "Error : Counters should not be available for failed job")
         self.assertEqual(None, job.counter(group='Map-Reduce Framework', counter='Map input records'))
示例#4
0
 def test_failed_job_status(self):
     _stderr = os.path.join(os.path.dirname(__file__), 'resources',
                            'mapreduce', 'failed_job_status')
     with open(_stderr) as _file:
         job = JobStatus("test_job")
         job._parse_stdout_(stream="\n".join(_file.readlines()))
         self.assertFalse(job.is_running())
         self.assertTrue(job.is_failed())
         self.assertEqual(
             'task 1412153770896_0092_m_000000 failed 9 times '
             'For details check tasktracker at: vm-cluster-node4:8041',
             job.failure_reason())
         self.assertEqual(
             0, len(job.counters()),
             "Error : Counters should not be available for failed job")
         self.assertEqual(
             None,
             job.counter(group='Map-Reduce Framework',
                         counter='Map input records'))