Sanil15 commented on a change in pull request #1378:
URL: https://github.com/apache/samza/pull/1378#discussion_r437009365



##########
File path: 
samza-core/src/test/java/org/apache/samza/clustermanager/TestContainerPlacementActions.java
##########
@@ -1011,4 +1026,13 @@ private void assertBadRequests(String processorId, 
String destinationHost, Conta
     // Request shall be deleted as soon as it is acted upon
     
assertFalse(containerPlacementMetadataStore.readContainerPlacementRequestMessage(requestMessage.getUuid()).isPresent());
   }
+
+  private void 
cleanUpRequestAllocatorThread(ContainerPlacementRequestAllocator 
requestAllocator, Thread containerPlacementRequestAllocatorThread) {
+    requestAllocator.stop();
+    try {
+      containerPlacementRequestAllocatorThread.join();
+    } catch (InterruptedException ie) {
+      Thread.currentThread().interrupt();
+    }
+  }

Review comment:
       Not every test instantiates a ContainerPlacementRequestAllocator only 
two tests do hence this cleanup.
   
   Also two tests use this individually, notice its not used in setup

##########
File path: 
samza-core/src/test/java/org/apache/samza/clustermanager/TestContainerPlacementActions.java
##########
@@ -266,9 +274,10 @@ public Void answer(InvocationOnMock invocation) {
   @Test(timeout = 30000)
   public void testActionQueuingForConsecutivePlacementActions() throws 
Exception {
     // Spawn a Request Allocator Thread
-    Thread requestAllocatorThread = new Thread(
-        new 
ContainerPlacementRequestAllocator(containerPlacementMetadataStore, cpm, new 
ApplicationConfig(config)),
-        "ContainerPlacement Request Allocator Thread");
+    ContainerPlacementRequestAllocator requestAllocator =
+        new 
ContainerPlacementRequestAllocator(containerPlacementMetadataStore, cpm, new 
ApplicationConfig(config));
+    Thread requestAllocatorThread = new Thread(requestAllocator, 
"ContainerPlacement Request Allocator Thread");
+

Review comment:
       No this is not used by every tests only two tests use this route of 
injecting control messages not all the tests




----------------------------------------------------------------
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]


Reply via email to