@After
 public void afterEach() {
   if (server != null) {
     server.close();
     server = null;
   }
 }
 /** Creates an ExternalShuffleClient and attempts to register with the server. */
 private void validate(String appId, String secretKey) throws IOException {
   ExternalShuffleClient client =
       new ExternalShuffleClient(conf, new TestSecretKeyHolder(appId, secretKey), true);
   client.init(appId);
   // Registration either succeeds or throws an exception.
   client.registerWithShuffleServer(
       TestUtils.getLocalHost(),
       server.getPort(),
       "exec0",
       new ExecutorShuffleInfo(new String[0], 0, ""));
   client.close();
 }