code: def testCondConstPropagation_errorMsg_xlaCompile(self):
      with self.session() as sess, self.test_scope():
          xla_context = control_flow_ops.XLAControlFlowContext()
          xla_context.Enter()
  
          x = array_ops.placeholder(dtypes.float32)
          p = random_ops.random_uniform(
              [], minval=1, maxval=3, dtype=dtypes.int32
          )
          condition = math_ops.cast(
              random_ops.random_uniform(
                  [], minval=0, maxval=2, dtype=dtypes.int32
              ),
              dtypes.bool,
          )
  
          def f():
              # TODO(b/129021699): Wrapping this in a tf.function does not work.
              def if_true():
                  # This emits a StridedSlice op which expects the index to be a
                  # compile-time const.
                  return x[:p]
  
              def if_false():
                  return array_ops.fill([p], 5.0)
  
              return cond.cond(condition, if_true, if_false)
  
          output = xla.compile(f)
  
          with self.assertRaisesRegex(
              errors.InvalidArgumentError,
              "must be a compile-time constant",
          ):
              sess.run(
                  output,
                  feed_dict={
                      x: [0.0, 1.0, 2.0],
                  },
              )
  
          xla_context.Exit()
  
imports: from tensorflow.compiler.tests import xla_test
  from tensorflow.python.client import session
  from tensorflow.python.compiler.xla import xla
  from tensorflow.python.eager import def_function
  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 cond
  from tensorflow.python.ops import control_flow_ops
  from tensorflow.python.ops import control_flow_switch_case
  from tensorflow.python.ops import math_ops
  from tensorflow.python.ops import random_ops
  from tensorflow.python.ops import tensor_array_ops
  from tensorflow.python.platform import test
label_desc: Use image node_id 7 for calling the CondTest obj's underlying member method code with example usage: obj.testCondConstPropagation_errorMsg_xlaCompile() and returns: cond, x, array_ops