'Test jobs with genuine failure, not just killed'

def test_failed_jobs(self):

    if is_live_cluster():
        raise SkipTest('HUE-2902:    Skipping    because    test    is    not    reentrant')
    INPUT_DIR = (TestJobBrowserWithHadoop.home_dir + '/input')
    OUTPUT_DIR = (TestJobBrowserWithHadoop.home_dir + '/output')
    try:
        TestJobBrowserWithHadoop.cluster.fs.mkdir((TestJobBrowserWithHadoop.home_dir + '/jt-test_failed_jobs'))
        TestJobBrowserWithHadoop.cluster.fs.mkdir(INPUT_DIR)
        TestJobBrowserWithHadoop.cluster.fs.rmtree(OUTPUT_DIR)
    except:
        LOG.exception('failed    to    teardown    tests')
    job_name = ('%s_%s' % (TestJobBrowserWithHadoop.username, 'test_failed_jobs-1'))
    response = TestJobBrowserWithHadoop.client.post(reverse('jobsub.views.new_design', kwargs={'node_type': 'mapreduce'}), {'name': [job_name], 'description': ['description    test_failed_jobs-1'], 'args': '', 'jar_path': '/user/hue/oozie/workspaces/lib/hadoop-examples.jar', 'prepares': '[]', 'archives': '[]', 'files': '[]', 'job_properties': [('[{"name":"mapred.input.dir","value":"%s"},                                                {"name":"mapred.output.dir","value":"%s"},                                                {"name":"mapred.mapper.class","value":"org.apache.hadoop.mapred.lib.dne"},                                                {"name":"mapred.combiner.class","value":"org.apache.hadoop.mapred.lib.dne"},                                                {"name":"mapred.reducer.class","value":"org.apache.hadoop.mapred.lib.dne"}]' % (INPUT_DIR, OUTPUT_DIR))]}, HTTP_X_REQUESTED_WITH='XMLHttpRequest', follow=True)
    design_dict = json.loads(response.content)
    design_id = int(design_dict['id'])
    response = TestJobBrowserWithHadoop.client.post(reverse('oozie:submit_workflow', args=[design_id]), data={u'form-MAX_NUM_FORMS': [u''], u'form-INITIAL_FORMS': [u'1'], u'form-0-name': [u'REDUCER_SLEEP_TIME'], u'form-0-value': [u'1'], u'form-TOTAL_FORMS': [u'1']}, follow=True)
    oozie_jobid = response.context['oozie_workflow'].id
    job = OozieServerProvider.wait_until_completion(oozie_jobid)
    hadoop_job_id = get_hadoop_job_id(TestJobBrowserWithHadoop.oozie, oozie_jobid, 1)
    hadoop_job_id_short = views.get_shorter_id(hadoop_job_id)
    response = TestJobBrowserWithHadoop.client.post('/jobbrowser/jobs/', {'format': 'json', 'state': 'killed'})
    assert_false((hadoop_job_id_short in response.content))
    response = TestJobBrowserWithHadoop.client.post('/jobbrowser/jobs/', {'format': 'json', 'state': 'failed'})
    assert_true((hadoop_job_id_short in response.content))
    raise SkipTest
    response = TestJobBrowserWithHadoop.client.get(('/jobbrowser/jobs/%s' % (hadoop_job_id,)))
    html = response.content.lower()
    assert_true(('failed    task' in html), html)
    map_task_id = (TestJobBrowserWithHadoop.hadoop_job_id.replace('job', 'task') + '_m_000000')
    response = TestJobBrowserWithHadoop.client.get(('/jobbrowser/jobs/%s/tasks/%s' % (hadoop_job_id, map_task_id)))
    assert_true(('succeed' in response.content))
    assert_true(('failed' not in response.content))
    reduce_task_id = (hadoop_job_id.replace('job', 'task') + '_r_000000')
    response = TestJobBrowserWithHadoop.client.get(('/jobbrowser/jobs/%s/tasks/%s' % (hadoop_job_id, reduce_task_id)))
    assert_true(('succeed' not in response.content))
    assert_true(('failed' in response.content))
    response = TestJobBrowserWithHadoop.client.get(('/jobbrowser/jobs/%s/tasks?taskstate=failed' % (hadoop_job_id,)))
    assert_true(('r_000000' in response.content))
    assert_true(('m_000000' not in response.content))
