rmatharu commented on a change in pull request #1108: SAMZA-2277: Semantics for 
cluster-manager.container.retry.window.ms not reflected in code
URL: https://github.com/apache/samza/pull/1108#discussion_r307903446
 
 

 ##########
 File path: 
samza-core/src/test/java/org/apache/samza/clustermanager/TestContainerProcessManager.java
 ##########
 @@ -338,6 +349,145 @@ public void 
testNewContainerRequestedOnFailureWithUnknownCode() throws Exception
     taskManager.stop();
   }
 
+  @Test
+  public void 
testContainerRequestedRetriesExceedingWindowOnFailureWithUnknownCode() throws 
Exception {
+    int maxRetries = 3;
+    String processorId = "0";
+    ClusterManagerConfig clusterManagerConfig = new 
ClusterManagerConfig(getConfigWithRetries(maxRetries));
+    SamzaApplicationState state = new 
SamzaApplicationState(getJobModelManagerWithoutHostAffinity(1));
+    MockClusterResourceManagerCallback callback = new 
MockClusterResourceManagerCallback();
+    MockClusterResourceManager clusterResourceManager = new 
MockClusterResourceManager(callback, state);
+
+    MockContainerAllocator allocator = new MockContainerAllocator(
+        clusterResourceManager,
+        clusterManagerConfig,
+        state);
+
+    ContainerProcessManager cpm =
+        buildContainerProcessManager(new MapConfig(clusterManagerConfig), 
state, clusterResourceManager, Optional.of(allocator));
+
+    // start triggers a request
+    cpm.start();
+
+    assertFalse(cpm.shouldShutdown());
+    assertEquals(1, allocator.getContainerRequestState().numPendingRequests());
+
+    SamzaResource container = new SamzaResource(1, 1024, "host1", "id0");
+    cpm.onResourceAllocated(container);
+
+    // Allow container to run and update state
+    if (!allocator.awaitContainersStart(1, 2, TimeUnit.SECONDS)) {
+      fail("timed out waiting for the containers to start");
+    }
+    cpm.onStreamProcessorLaunchSuccess(container);
+
+    // Mock 2nd failure exceeding retry window.
 
 Review comment:
   Nitpick: 
   "1st failure" ?

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


With regards,
Apache Git Services

Reply via email to