code: def test_id_is_newer():
      """
      Sanity checks the logic for ID is newer. In general, we would expect
      that higher IDs are newer than lower IDs, for example 25 can be assumed
      to be newer than 24.
      Since IDs roll over at INT32_MAX (~2**31), we should check for weird
      behavior there. In particular, we would expect an ID like `11` to be
      newer than the ID `2**31` since it's likely that the counter rolled
      over.
      """
      # Common cases -- higher IDs normally considered newer
      assert _id_is_newer(30, 29)
      assert _id_is_newer(12345, 12344)
      assert not _id_is_newer(12344, 12345)
      assert not _id_is_newer(5678, 5678)
  
      # Check behavior near max int boundary
      assert _id_is_newer(INT32_MAX, INT32_MAX - 1)
      assert _id_is_newer(INT32_MAX - 1, INT32_MAX - 2)
  
      # Low IDs are assumed newer than higher ones if it looks like rollover has
      # occurred
      assert _id_is_newer(0, INT32_MAX - 4)
      assert _id_is_newer(1001, INT32_MAX - 123)
      assert not _id_is_newer(INT32_MAX, 123)
  
file_path: ray/python/ray/tests/test_response_cache.py
imports: from ray.util.client.common import _id_is_newer, ResponseCache, OrderedResponseCache, INT32_MAX
  import threading
  import time
  import pytest
label_desc: Use image node_id 1 for calling a global function with example usage: test_id_is_newer() without return types