docstr: Tests task generation when example-gen service job fails.
docstr_tok: ["Tests","task","generation","when","example-gen","service","job","fails","."]
code: def test_service_job_failed(self, fail_fast):
      """Tests task generation when example-gen service job fails."""
  
      def _ensure_node_services(unused_pipeline_state, node_id):
          self.assertEqual("my_example_gen", node_id)
          return service_jobs.ServiceStatus(
              code=service_jobs.ServiceStatusCode.FAILED,
              msg="foobar error",
          )
  
      self._mock_service_job_manager.ensure_node_services.side_effect = (
          _ensure_node_services
      )
      [update_node_state_task, finalize_task] = self._generate_and_test(
          True,
          num_initial_executions=0,
          num_tasks_generated=2,
          num_new_executions=0,
          num_active_executions=0,
          fail_fast=fail_fast,
      )
      self.assertIsInstance(
          update_node_state_task, task_lib.UpdateNodeStateTask
      )
      self.assertEqual(
          "my_example_gen", update_node_state_task.node_uid.node_id
      )
      self.assertEqual(
          pstate.NodeState.FAILED, update_node_state_task.state
      )
      self.assertEqual(
          status_lib.Code.UNKNOWN, update_node_state_task.status.code
      )
      self.assertEqual(
          "service job failed; node uid:"
          " NodeUid(pipeline_uid=PipelineUid(pipeline_id='my_pipeline',"
          " pipeline_run_id=None), node_id='my_example_gen'); error message:"
          " foobar error",
          update_node_state_task.status.message,
      )
      self.assertIsInstance(
          finalize_task, task_lib.FinalizePipelineTask
      )
      self.assertEqual(
          status_lib.Code.UNKNOWN, finalize_task.status.code
      )
      self.assertRegex(finalize_task.status.message, "my_example_gen")
  
imports: import itertools
  import os
  from typing import Literal
  import uuid
  from absl.testing import parameterized
  from absl.testing.absltest import mock
  import tensorflow
  from tfx.dsl.compiler import constants
  from tfx.orchestration import data_types_utils
  from tfx.orchestration.experimental.core import constants
  from tfx.orchestration.experimental.core import mlmd_state
  from tfx.orchestration.experimental.core import pipeline_state
  from tfx.orchestration.experimental.core import service_jobs
  from tfx.orchestration.experimental.core import sync_pipeline_task_gen
  from tfx.orchestration.experimental.core import task
  from tfx.orchestration.experimental.core import task_gen_utils
  from tfx.orchestration.experimental.core import task_queue
  from tfx.orchestration.experimental.core import test_utils
  from tfx.orchestration.experimental.core.testing import test_sync_pipeline
  from tfx.orchestration import mlmd_connection_manager
  from tfx.orchestration.portable import runtime_parameter_utils
  from tfx.proto.orchestration import pipeline_pb2
  from tfx.utils import status
  from ml_metadata.proto import metadata_store_pb2
label_desc: Use image node_id 15 for calling the SyncPipelineTaskGeneratorTest obj's underlying member method code with example usage: obj.test_service_job_failed(fail_fast) and returns: service_jobs