This is an automated email from the ASF dual-hosted git repository.

jackie pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/pinot.git


The following commit(s) were added to refs/heads/master by this push:
     new 0ff43b517f Reset controller port when stopping the controller in 
ControllerTest (#13399)
0ff43b517f is described below

commit 0ff43b517f95d8c6af021674c76af9b5e6b61343
Author: Xiaotian (Jackie) Jiang <17555551+jackie-ji...@users.noreply.github.com>
AuthorDate: Fri Jun 14 16:03:13 2024 -0700

    Reset controller port when stopping the controller in ControllerTest 
(#13399)
---
 .../pinot/controller/helix/ControllerTest.java     | 25 +++++++++++-----------
 1 file changed, 13 insertions(+), 12 deletions(-)

diff --git 
a/pinot-controller/src/test/java/org/apache/pinot/controller/helix/ControllerTest.java
 
b/pinot-controller/src/test/java/org/apache/pinot/controller/helix/ControllerTest.java
index 090a32bf18..31ed486158 100644
--- 
a/pinot-controller/src/test/java/org/apache/pinot/controller/helix/ControllerTest.java
+++ 
b/pinot-controller/src/test/java/org/apache/pinot/controller/helix/ControllerTest.java
@@ -109,34 +109,34 @@ public class ControllerTest {
    */
   public static final ControllerTest DEFAULT_INSTANCE = new ControllerTest();
 
-  protected final String _clusterName = getClass().getSimpleName();
+  protected static HttpClient _httpClient;
 
-  protected static HttpClient _httpClient = null;
+  protected final String _clusterName = getClass().getSimpleName();
+  protected final List<HelixManager> _fakeInstanceHelixManagers = new 
ArrayList<>();
 
   protected int _nextControllerPort = 16000;
   protected int _nextBrokerPort = 17000;
   protected int _nextServerPort = 18000;
   protected int _nextMinionPort = 19000;
 
+  private ZkStarter.ZookeeperInstance _zookeeperInstance;
+
+  // The following fields need to be reset when stopping the controller.
+  protected BaseControllerStarter _controllerStarter;
   protected int _controllerPort;
-  protected String _controllerBaseApiUrl;
+  protected ControllerRequestClient _controllerRequestClient;
+
+  // The following fields are always set when controller is started. No need 
to reset them when stopping the controller.
   protected ControllerConf _controllerConfig;
+  protected String _controllerBaseApiUrl;
   protected ControllerRequestURLBuilder _controllerRequestURLBuilder;
-
-  protected ControllerRequestClient _controllerRequestClient = null;
-
-  protected final List<HelixManager> _fakeInstanceHelixManagers = new 
ArrayList<>();
   protected String _controllerDataDir;
-
-  protected BaseControllerStarter _controllerStarter;
   protected PinotHelixResourceManager _helixResourceManager;
   protected HelixManager _helixManager;
-  protected HelixAdmin _helixAdmin;
   protected HelixDataAccessor _helixDataAccessor;
+  protected HelixAdmin _helixAdmin;
   protected ZkHelixPropertyStore<ZNRecord> _propertyStore;
 
-  private ZkStarter.ZookeeperInstance _zookeeperInstance;
-
   /**
    * Acquire the {@link ControllerTest} default instance that can be shared 
across different test cases.
    *
@@ -291,6 +291,7 @@ public class ControllerTest {
     assertNotNull(_controllerStarter, "Controller hasn't been started");
     _controllerStarter.stop();
     _controllerStarter = null;
+    _controllerPort = 0;
     _controllerRequestClient = null;
     FileUtils.deleteQuietly(new File(_controllerDataDir));
   }


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscr...@pinot.apache.org
For additional commands, e-mail: commits-h...@pinot.apache.org

Reply via email to