docstr: Pre-build fails, but is kicked off again.
docstr_tok: ["Pre-build","fails",",","but","is","kicked","off","again","."]
code: def testBuildClusterEnvPreBuildFailed(self):
      """Pre-build fails, but is kicked off again."""
      self.cluster_manager.set_cluster_env()
      self.cluster_manager.cluster_env_id = "correct"
  
      # Build failed on first lookup
      self.cluster_manager.cluster_env_build_id = None
      self.sdk.reset()
      self.sdk.returns["list_cluster_environment_builds"] = APIDict(
          results=[
              APIDict(
                  id="build_failed",
                  status="failed",
                  created_at=0,
                  error_message=None,
                  config_json={},
              )
          ]
      )
      self.sdk.returns["create_cluster_environment_build"] = APIDict(
          result=APIDict(id="new_build_id")
      )
      self.sdk.returns["get_build"] = APIDict(
          result=APIDict(
              id="build_now_succeeded",
              status="failed",
              created_at=0,
              error_message=None,
              config_json={},
          )
      )
      with self.assertRaisesRegex(
          ClusterEnvBuildError, "Cluster env build failed"
      ):
          self.cluster_manager.build_cluster_env(timeout=600)
      self.assertFalse(self.cluster_manager.cluster_env_build_id)
      self.assertEqual(
          self.sdk.call_counter["list_cluster_environment_builds"], 1
      )
      self.assertEqual(
          self.sdk.call_counter["create_cluster_environment_build"], 1
      )
      self.assertEqual(len(self.sdk.call_counter), 3)
  
imports: import os
  import sys
  import time
  import unittest
  from typing import Callable
  from unittest.mock import patch
  from freezegun import freeze_time
  from ray_release.exception import ClusterCreationError, ClusterStartupError, ClusterStartupTimeout, ClusterStartupFailed, ClusterEnvBuildError, ClusterEnvBuildTimeout, ClusterComputeCreateError, ClusterEnvCreateError
  from ray_release.cluster_manager.full import FullClusterManager
  from ray_release.cluster_manager.minimal import MinimalClusterManager
  from ray_release.tests.utils import UNIT_TEST_PROJECT_ID, UNIT_TEST_CLOUD_ID, APIDict, fail_always, fail_once, MockSDK
  from ray_release.util import get_anyscale_sdk
  from ray_release.test import Test
label_desc: Use image node_id 14 for calling the MinimalSessionManagerTest obj's underlying member method code with example usage: obj.testBuildClusterEnvPreBuildFailed() without return types