@Override
    public void run() {
      try {
        List<ConnectedChannel> connectedChannels = new ArrayList<ConnectedChannel>();
        for (String channelStr : channelCount.keySet()) {
          Port port = channelToPortMap.get(channelStr);
          ConnectedChannel channel =
              connectionPool.checkOutConnection("localhost", new Port(port.getPort(), port.getPortType()), 1000);
          connectedChannels.add(channel);
          channelCount.get(channelStr).countDown();
        }
        if (shouldRelease.await(5000, TimeUnit.MILLISECONDS)) {
          for (ConnectedChannel channel : connectedChannels) {
            if (destroyConnection) {
              connectionPool.destroyConnection(channel);
            } else {
              connectionPool.checkInConnection(channel);
            }
          }
        } else if (exception.get() == null) {
          exception.set(new Exception("Timed out waiting for signal to release connections"));
        }
      } catch (Exception e) {
        exception.set(e);
      } finally {
        releaseComplete.countDown();
      }
    }
Starts up an ambry server given a port number in localhost

@param port the port number over which ambry server needs to be started
@return the {@link SocketServer} referring to ambry's instance
@throws IOException
@throws InterruptedException
ambry-network/src/test/java/com/github/ambry/network/BlockingChannelConnectionPoolTest.java