code: def test_creating_variable(self):
      # See PeerFailureTest.test_creating_variable
  
      def worker_fn(attempts):
          strategy = (
              tf.distribute.experimental.MultiWorkerMirroredStrategy()
          )
          task_id, attempt = get_attempt(strategy, attempts)
          with strategy.scope():
              tf.Variable(1.0)
              # worker-1 dies here.
              if attempt == 1 and task_id == 1:
                  quick_exit(1)
              v = tf.Variable(tf.random.uniform(()))
              return v.read_value().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.assertEqual(results[0], results[1])
  
file_path: tensorflow/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 1 for calling the PeerFailureRecoverTest obj's underlying member method code with example usage: obj.test_creating_variable() and returns: v