code: def test_redis_raises_error_if_failing(redis_mock):
      import redis
  
      my_queue = QueuingSystem.REDIS.get_api_delta_queue(
          queue_id="test_redis_queue_warning"
      )
      redis_mock.return_value.rpush.side_effect = (
          redis.exceptions.ConnectionError("EROOOR")
      )
      redis_mock.return_value.llen.side_effect = (
          redis.exceptions.ConnectionError("EROOOR")
      )
  
      with pytest.raises(
          ConnectionError,
          match="Your app failed because it couldn't connect to Redis.",
      ):
          redis_mock.return_value.blpop.side_effect = (
              redis.exceptions.ConnectionError("EROOOR")
          )
          my_queue.get()
  
      with pytest.raises(
          ConnectionError,
          match="Your app failed because it couldn't connect to Redis.",
      ):
          redis_mock.return_value.rpush.side_effect = (
              redis.exceptions.ConnectionError("EROOOR")
          )
          redis_mock.return_value.llen.return_value = 1
          my_queue.put(1)
  
      with pytest.raises(
          ConnectionError,
          match="Your app failed because it couldn't connect to Redis.",
      ):
          redis_mock.return_value.llen.side_effect = (
              redis.exceptions.ConnectionError("EROOOR")
          )
          my_queue.length()
  
imports: import base64
  import multiprocessing
  import pickle
  import queue
  import time
  from unittest import mock
  import pytest
  import requests_mock
  from lightning.app import LightningFlow
  from lightning.app.core import queues
  from lightning.app.core.constants import HTTP_QUEUE_URL, STATE_UPDATE_TIMEOUT
  from lightning.app.core.queues import READINESS_QUEUE_CONSTANT, BaseQueue, HTTPQueue, QueuingSystem, RateLimitedQueue, RedisQueue
  from lightning.app.utilities.imports import _is_redis_available
  from lightning.app.utilities.redis import check_if_redis_running
label_desc: Use image node_id 9 for calling a global function with example usage: test_redis_raises_error_if_failing(redis_mock) without return types