code: def test_reduce_small_tensor(self):
      # See PeerFailureTest.test_reduce_small_tensor
  
      def worker_fn(attempts):
          strategy = (
              tf.distribute.experimental.MultiWorkerMirroredStrategy()
          )
          task_id, attempt = get_attempt(strategy, attempts)
          value = tf.identity([1.0])
          strategy.reduce("sum", value, axis=None)
          # worker-1 dies here.
          if attempt == 1 and task_id == 1:
              quick_exit(1)
          return strategy.reduce("sum", value, axis=None).numpy()
  
      cluster_spec = multi_worker_test_base.create_cluster_spec(
          num_workers=2
      )
      attempts = multi_process_runner.manager().dict()
      mpr = multi_process_runner.MultiProcessRunner(
          worker_fn,
          cluster_spec,
          rpc_layer=RPC_PROTOCOL,
          args=(attempts,),
          auto_restart=True,
      )
      mpr.start()
      results = mpr.join(timeout=90).return_value
      self.assertAllEqual(results, [[2.0], [2.0]])
  
file_path: tensorflow-upstream/tensorflow/python/distribute/integration_test/mwms_peer_failure_test.py
imports: import os
  import tensorflow
  from tensorflow.python.distribute import collective_all_reduce_strategy
  from tensorflow.python.distribute import multi_process_runner
  from tensorflow.python.distribute import multi_worker_test_base
  from tensorflow.python.distribute import test_util
  from tensorflow.python.eager import test
label_desc: Use image node_id 2 for calling the PeerFailureRecoverTest obj's underlying member method code with example usage: obj.test_reduce_small_tensor() and returns: strategy