code: def testCheckHealthPeerRestart(self):
      def worker_fn():
          cluster_resolver = (
              cluster_resolver_lib.TFConfigClusterResolver()
          )
          enable_collective_ops(cluster_resolver)
  
          collective_ops.all_reduce(
              constant_op.constant(1.0),
              group_size=2,
              group_key=100,
              instance_key=100,
              merge_op="Add",
              final_op="Id",
              communication_hint="ring",
          )
  
          if cluster_resolver.task_type == "worker":
              # MultiProcessRunner will auto restart worker-0.
              os._exit(1)  # pylint: disable=protected-access
          else:
              # chief should eventually gets FailedPreconditionError after worker-0
              # has restarted.
              while True:
                  time.sleep(1)
                  try:
                      context.context().check_collective_ops_peer_health(
                          "/job:worker/replica:0/task:0",
                          timeout_in_ms=1000,
                      )
                  except errors.UnavailableError:
                      pass
                  except errors.FailedPreconditionError:
                      break
  
      cluster_spec = multi_worker_test_base.create_cluster_spec(
          has_chief=True, num_workers=1
      )
      mpr = multi_process_runner.MultiProcessRunner(
          worker_fn, cluster_spec, auto_restart=True
      )
      mpr.start()
      mpr.join()
  
imports: import copy
  import os
  import threading
  import time
  from absl.testing import parameterized
  from tensorflow.core.protobuf import tensorflow_server_pb2
  from tensorflow.python.distribute import cluster_resolver
  from tensorflow.python.distribute import combinations
  from tensorflow.python.distribute import multi_process_runner
  from tensorflow.python.distribute import multi_worker_test_base
  from tensorflow.python.eager import context
  from tensorflow.python.eager import test
  from tensorflow.python.framework import constant_op
  from tensorflow.python.framework import dtypes
  from tensorflow.python.framework import errors
  from tensorflow.python.framework import ops
  from tensorflow.python.ops import collective_ops
label_desc: Use image node_id 3 for calling the CollectiveOpTest obj's underlying member method code with example usage: obj.testCheckHealthPeerRestart() without return types