code: def test_run_happy_path(
      self, record_events_mock, mock_monitor_workers
  ):
      # worker starts
      # is always healthy
      # then succeeds
      max_restarts = 10
      spec = self._get_worker_spec(max_restarts)
      agent = TestAgent(spec)
  
      agent.run()
  
      # no failure, no membership changes -> no retries
      self.assertEqual(max_restarts, agent._remaining_restarts)
      record_events_mock.assert_called_once()
  
imports: import signal
  import unittest
  import uuid
  from typing import Any, Dict
  from unittest.mock import call, patch, MagicMock
  import torch.distributed.elastic.rendezvous.registry
  from torch.distributed.elastic.agent.server.api import RunResult, SimpleElasticAgent, WorkerGroup, WorkerSpec, WorkerState, _get_fq_hostname, _RoleInstanceInfo
  from torch.distributed.elastic.multiprocessing import SignalException
  from torch.distributed.elastic.multiprocessing.errors import ProcessFailure
  from torch.distributed.elastic.rendezvous import RendezvousHandler, RendezvousParameters
  from torch.distributed.elastic.utils.distributed import get_free_port
  from torch.testing._internal.common_utils import run_tests
label_desc: Use image node_id 17 for calling the SimpleElasticAgentTest obj's underlying member method code with example usage: obj.test_run_happy_path(record_events_mock, mock_monitor_workers) without return types