code: def test_reservation_environment_exists_start_listening_socket_return_socket_listening_to_environment_port_range(
      self,
  ):
      tfos_server1 = Server(1)
      tfos_server2 = Server(1)
      tfos_server3 = Server(1)
      with mock.patch.dict(
          os.environ, {"TFOS_SERVER_PORT": "9998-9999"}
      ):
          s1 = tfos_server1.start_listening_socket()
          self.assertEqual(s1.getsockname()[1], 9998)
          s2 = tfos_server2.start_listening_socket()
          self.assertEqual(s2.getsockname()[1], 9999)
          with self.assertRaises(Exception):
              tfos_server3.start_listening_socket()
      tfos_server1.stop()
      tfos_server2.stop()
  
file_path: TensorFlowOnSpark/tests/test_reservation.py
imports: import os
  import threading
  import time
  import unittest
  from tensorflowonspark import util
  from tensorflowonspark.reservation import Reservations, Server, Client
  from unittest import mock
label_desc: Use image node_id 8 for calling the ReservationTest obj's underlying member method code with example usage: obj.test_reservation_environment_exists_start_listening_socket_return_socket_listening_to_environment_port_range() without return types