@Override
    public void run() {
      try {
        BlockingChannel channel = channelInfo.getBlockingChannel(1000);
        channelCount.countDown();
        if (shouldRelease.await(1000, TimeUnit.MILLISECONDS)) {
          if (destroyConnection) {
            channelInfo.destroyBlockingChannel(channel);
          } else {
            channelInfo.releaseBlockingChannel(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();
      }
    }
Run only once for all tests
ambry-network/src/test/java/com/github/ambry/network/BlockingChannelConnectionPoolTest.java