docstr: Test that two sessions using ClusterSpec propagation are isolated.
docstr_tok: ["Test","that","two","sessions","using","ClusterSpec","propagation","are","isolated","."]
code: def testClusterSpecPropagationIsolation(self):
      """Test that two sessions using ClusterSpec propagation are isolated."""
      server = server_lib.Server.create_local_server()
      init_value = array_ops.placeholder(dtypes.int32, shape=[])
      v = variables.Variable(init_value)
  
      cluster_def = cluster_pb2.ClusterDef()
      job = cluster_def.job.add()
      job.name = "worker"
      job.tasks[0] = server.target[len("grpc://") :]
      config = config_pb2.ConfigProto(cluster_def=cluster_def)
  
      sess1 = session.Session(server.target, config=config)
      sess2 = session.Session(server.target, config=config)
  
      # Initially, the variable is uninitialized in both sessions.
      with self.assertRaises(errors.FailedPreconditionError):
          sess1.run(v)
      with self.assertRaises(errors.FailedPreconditionError):
          sess2.run(v)
  
      # An update in sess1 should be visible in sess1 only.
      sess1.run(v.initializer, feed_dict={init_value: 37})
      self.assertEqual(37, sess1.run(v))
      with self.assertRaises(errors.FailedPreconditionError):
          sess2.run(v)
  
      # An update in sess2 should be visible in sess2 only.
      sess2.run(v.initializer, feed_dict={init_value: 86})
      self.assertEqual(37, sess1.run(v))
      self.assertEqual(86, sess2.run(v))
  
      # Closing sess2 has no effect on the state of sess1.
      sess2.close()
      self.assertEqual(37, sess1.run(v))
  
      # Subsequent sessions will not see the state of existing sessions.
      sess3 = session.Session(server.target, config=config)
      self.assertEqual(37, sess1.run(v))
      with self.assertRaises(errors.FailedPreconditionError):
          sess3.run(v)
  
imports: import numpy
  from tensorflow.core.protobuf import cluster_pb2
  from tensorflow.core.protobuf import config_pb2
  from tensorflow.python.client import session
  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.framework import test_util
  from tensorflow.python.ops import array_ops
  from tensorflow.python.ops import math_ops
  from tensorflow.python.ops import resource_variable_ops
  from tensorflow.python.ops import state_ops
  from tensorflow.python.ops import variables
  from tensorflow.python.platform import googletest
  from tensorflow.python.platform import test
  from tensorflow.python.training import server_lib
label_desc: Use image node_id 11 for calling the SessionClusterSpecPropagationTest obj's underlying member method code with example usage: obj.testClusterSpecPropagationIsolation() without return types