code: def test_seal_memory(shutdown_only):
      """Test objects sealed states reported correctly"""
      import numpy as np
  
      info = ray.init(
          object_store_memory=100 * MiB,
          _system_config=_SYSTEM_CONFIG,
      )
  
      # Allocate 80MiB data
      objs_in_use = ray.get(
          [
              ray.put(np.zeros(20 * MiB, dtype=np.uint8))
              for _ in range(4)
          ]
      )
  
      expected = {
          "SEALED": 80 * MiB,
          "UNSEALED": 0,
      }
  
      wait_for_condition(
          # 1KiB for metadata difference
          lambda: approx_eq_dict_in(
              objects_by_seal_state(info), expected, 2 * KiB
          ),
          timeout=20,
          retry_interval_ms=500,
      )
  
      del objs_in_use
  
      expected = {
          "SEALED": 0,
          "UNSEALED": 0,
      }
  
      wait_for_condition(
          # 1KiB for metadata difference
          lambda: approx_eq_dict_in(
              objects_by_seal_state(info), expected, 2 * KiB
          ),
          timeout=20,
          retry_interval_ms=500,
      )
  
file_path: ray/python/ray/tests/test_object_store_metrics.py
imports: from collections import defaultdict
  import pytest
  from typing import Dict
  import numpy
  import sys
  import requests
  import ray
  from ray._private.test_utils import raw_metrics, wait_for_condition
  from ray._private.worker import RayContext
label_desc: Use image node_id 8 for calling a global function with example usage: test_seal_memory(shutdown_only) without return types