code: def test_task_put(shutdown_only):
      local_fs_capacity_threshold = calculate_capacity_threshold(
          1 * 1024 * 1024
      )
      ray.init(
          num_cpus=1,
          object_store_memory=80 * 1024 * 1024,
          _system_config={
              "local_fs_capacity_threshold": local_fs_capacity_threshold,
              "local_fs_monitor_interval_ms": 10,
          },
      )
  
      # create a temp file so that the disk size is over the threshold.
      # ray.put doesn't work is that fallback allocation uses mmaped file
      # that doesn't neccssary allocate disk spaces.
      with create_tmp_file(250 * 1024 * 1024):
          assert get_current_usage() > local_fs_capacity_threshold
          time.sleep(1)
  
          @ray.remote
          def foo():
              ref = ray.put(
                  np.random.rand(20 * 1024 * 1024)
              )  # 160 MB data
              return ref
  
          try:
              ray.get(foo.remote())
          except ray.exceptions.RayTaskError as e:
              assert isinstance(e.cause, ray.exceptions.OutOfDiskError)
  
file_path: ray/python/ray/tests/test_out_of_disk_space.py
imports: import os
  import platform
  import shutil
  import sys
  import tempfile
  import time
  from contextlib import contextmanager
  import numpy
  import pytest
  import ray
  from ray.util.state import list_cluster_events
label_desc: Use image node_id 6 for calling a global function with example usage: test_task_put(shutdown_only) and returns: ref