narendly commented on a change in pull request #1157:
URL: https://github.com/apache/helix/pull/1157#discussion_r457631317



##########
File path: 
helix-core/src/test/java/org/apache/helix/controller/stages/TestRebalancePipeline.java
##########
@@ -61,8 +62,11 @@ public void testDuplicateMsg() {
     HelixManager manager = new DummyClusterManager(clusterName, accessor);
     ClusterEvent event = new ClusterEvent(ClusterEventType.Unknown);
     event.addAttribute(AttributeName.helixmanager.name(), manager);
-    event.addAttribute(AttributeName.ControllerDataProvider.name(),
-        new ResourceControllerDataProvider());
+    ResourceControllerDataProvider dataCache = new 
ResourceControllerDataProvider();
+    // The AsyncTasksThreadPool needs to be set, otherwise to start pending 
message cleanup job
+    // will throw NPE and stop the pipeline. TODO: 
https://github.com/apache/helix/issues/1158
+    dataCache.setAsyncTasksThreadPool(Executors.newSingleThreadExecutor());

Review comment:
       Another important thing we should do here is to shut down the 
threads/thread pool. Otherwise, there will be a thread pool/thread leak 
throughout the test suite. This has been a real pain for Helix's test suite, so 
let's make sure we don't leak it here.
   
   We could pull out this single thread executor to create a reference and shut 
it down at the end of the test.




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
[email protected]



---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to