code: def test_reservation_environment_exists_start_listening_socket_return_socket_listening_to_environment_port_value(
      self,
  ):
      tfos_server = Server(1)
      with mock.patch.dict(os.environ, {"TFOS_SERVER_PORT": "9999"}):
          assert (
              tfos_server.start_listening_socket().getsockname()[1]
              == 9999
          )
  
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 5 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_value() without return types