code: def test_metrics_override_shouldnt_warn(
      ray_start_regular, log_pubsub
  ):
      # https://github.com/ray-project/ray/issues/12859
  
      @ray.remote
      def override():
          a = Counter("num_count", description="")
          b = Counter("num_count", description="")
          a.inc(1)
          b.inc(1)
  
      ray.get(override.remote())
  
      # Check the stderr from the worker.
      def matcher(log_batch):
          return any(
              "Attempt to register measure" in line
              for line in log_batch["lines"]
          )
  
      match = get_log_batch(log_pubsub, 1, timeout=5, matcher=matcher)
      assert len(match) == 0, match
  
imports: import signal
  import json
  import os
  import pathlib
  import sys
  import requests
  from pprint import pformat
  from unittest.mock import MagicMock
  import numpy
  import pytest
  import ray
  from ray.util.state import list_nodes
  from ray._private.metrics_agent import PrometheusServiceDiscoveryWriter
  from ray._private.ray_constants import PROMETHEUS_SERVICE_DISCOVERY_FILE
  from ray._private.test_utils import SignalActor, fetch_prometheus, fetch_prometheus_metrics, get_log_batch, wait_for_condition, raw_metrics
  from ray.autoscaler._private.constants import AUTOSCALER_METRIC_PORT
  from ray.dashboard.consts import DASHBOARD_METRIC_PORT
  from ray.util.metrics import Counter, Gauge, Histogram
label_desc: Use image node_id 13 for calling a global function with example usage: test_metrics_override_shouldnt_warn(ray_start_regular, log_pubsub) and returns: any