class_docstr: Test all storage backend
class_docstr_tok: ["Test","all","storage","backend"]
code: def test_acquire_algorithm_lock_handle_fail(self, storage):
      with OrionState(
          experiments=[base_experiment], storage=storage
      ) as cfg:
          storage = cfg.storage
          experiment = cfg.get_experiment("default_name", version=None)
          with storage.acquire_algorithm_lock(
              experiment
          ) as locked_algo_state:
              assert locked_algo_state.state is None
              locked_algo_state.set_state("new original state")
  
          with pytest.raises(RuntimeError):
              with storage.acquire_algorithm_lock(
                  experiment
              ) as locked_algo_state:
                  assert locked_algo_state.state == "new original state"
                  locked_algo_state.set_state("should not be set")
                  raise RuntimeError
  
          with storage.acquire_algorithm_lock(
              experiment
          ) as locked_algo_state:
              assert locked_algo_state.state == "new original state"
  
imports: import copy
  import datetime
  import logging
  import os
  import pickle
  import time
  import pytest
  import orion.core
  from orion.core.io.database import DuplicateKeyError
  from orion.core.io.database.pickleddb import PickledDB
  from orion.core.worker.trial import Trial
  from orion.storage.base import FailedUpdate, LockAcquisitionTimeout, LockedAlgorithmState, MissingArguments, setup_storage
  from orion.storage.legacy import Legacy
  from orion.storage.track import HAS_TRACK, REASON
  from orion.testing import OrionState, base_experiment
label_desc: Use image node_id 33 for calling the TestStorage obj's underlying member method code with example usage: obj.test_acquire_algorithm_lock_handle_fail(storage) without return types