docstr: Update cluster when other remote function calls are being launched.
docstr_tok: ["Update","cluster","when","other","remote","function","calls","are","being","launched","."]
code: def testMultiThreadPendingNodesLockFree(self):
      """Update cluster when other remote function calls are being launched."""
  
      with ops.device(self.device_t1):
          x1 = array_ops.ones([2, 2])
  
      num_calls = 10
      self._coord = coordinator.Coordinator()
  
      @def_function.function
      def worker_fn(i):
          return math_ops.matmul(i, i)
  
      # Forces function tracing and registration
      worker_fn.get_concrete_function(x1)
  
      def thread_fn(device, results):
          for i in range(num_calls):
              with self._coord.stop_on_exception():
                  with ops.device(device):
                      results[i] = worker_fn(x1).numpy()
  
      def update_server_def_fn():
          for _ in range(30):
              with self._coord.stop_on_exception():
                  context.update_server_def(self.server_def_s1_s2)
  
      t1_results = [None] * num_calls
      t2_results = [None] * num_calls
      threads = []
      threads.append(
          threading.Thread(
              target=thread_fn, args=(self.device_t1, t1_results)
          )
      )
      threads.append(
          threading.Thread(
              target=thread_fn, args=(self.device_t2, t2_results)
          )
      )
      threads.append(threading.Thread(target=update_server_def_fn))
      for t in threads:
          t.start()
      self._coord.join(threads)
      for result in t1_results + t2_results:
          np.testing.assert_array_equal([[2, 2], [2, 2]], result)
  
imports: import os
  import threading
  from absl.testing import parameterized
  import numpy
  from tensorflow.core.distributed_runtime.preemption import gen_check_preemption_op
  from tensorflow.core.protobuf import cluster_pb2
  from tensorflow.core.protobuf import tensorflow_server_pb2
  from tensorflow.python import pywrap_tfe
  from tensorflow.python.eager import context
  from tensorflow.python.eager import def_function
  from tensorflow.python.eager import executor
  from tensorflow.python.framework import errors
  from tensorflow.python.framework import ops
  from tensorflow.python.framework import test_util
  from tensorflow.python.ops import array_ops
  from tensorflow.python.ops import math_ops
  from tensorflow.python.ops import variables
  from tensorflow.python.platform import test
  from tensorflow.python.training import coordinator
  from tensorflow.python.training import server_lib
label_desc: Use image node_id 15 for calling the DynamicClusterTest obj's underlying member method code with example usage: obj.testMultiThreadPendingNodesLockFree() and returns: math_ops