code: def test_invalid_config_raises_exception(shutdown_only):
      # Make sure ray.init raises an exception before
      # it starts processes when invalid object spilling
      # config is given.
      with pytest.raises(ValueError):
          ray.init(
              _system_config={
                  "object_spilling_config": json.dumps({"type": "abc"}),
              }
          )
  
      with pytest.raises(Exception):
          copied_config = copy.deepcopy(
              file_system_object_spilling_config
          )
          # Add invalid params to the config.
          copied_config["params"].update({"random_arg": "abc"})
          ray.init(
              _system_config={
                  "object_spilling_config": json.dumps(copied_config),
              }
          )
  
      with pytest.raises(Exception):
          copied_config = copy.deepcopy(
              file_system_object_spilling_config
          )
          # Add invalid value type to the config.
          copied_config["params"].update({"buffer_size": "abc"})
          ray.init(
              _system_config={
                  "object_spilling_config": json.dumps(copied_config),
              }
          )
  
imports: import copy
  import json
  import platform
  import random
  import sys
  from datetime import datetime, timedelta
  from unittest.mock import patch
  import numpy
  import pytest
  import ray
  from ray._private.external_storage import create_url_with_offset, parse_url_with_offset, _get_unique_spill_filename, FileSystemStorage, ExternalStorageSmartOpenImpl
  from ray._private.internal_api import memory_summary
  from ray._private.test_utils import wait_for_condition
  from ray._raylet import GcsClientOptions
  from ray.tests.conftest import buffer_object_spilling_config, file_system_object_spilling_config, mock_distributed_fs_object_spilling_config
label_desc: Use image node_id 5 for calling a global function with example usage: test_invalid_config_raises_exception(shutdown_only) without return types