bkonold commented on a change in pull request #1366:
URL: https://github.com/apache/samza/pull/1366#discussion_r432043551



##########
File path: samza-core/src/test/java/org/apache/samza/container/TestRunLoop.java
##########
@@ -390,23 +401,21 @@ public void testCommitSingleTask() throws Exception {
     when(consumerMultiplexer.pollIntervalMs()).thenReturn(10);
     OffsetManager offsetManager = mock(OffsetManager.class);
 
-    TestTask task0 = new TestTask(true, true, false, 
task0ProcessedMessagesLatch);
+    TestTask task0 = spy(createTestTask(true, true, false, 
task0ProcessedMessagesLatch, 0, taskName0, ssp0, offsetManager));
     task0.setCommitRequest(TaskCoordinator.RequestScope.CURRENT_TASK);
-    TestTask task1 = new TestTask(true, false, true, 
task1ProcessedMessagesLatch);
-    TaskInstance t0 = createTaskInstance(task0, taskName0, ssp0, 
offsetManager, consumerMultiplexer);
-    TaskInstance t1 = createTaskInstance(task1, taskName1, ssp1, 
offsetManager, consumerMultiplexer);
+    TestTask task1 = spy(createTestTask(true, false, true, 
task1ProcessedMessagesLatch, 0, taskName1, ssp1, offsetManager));
 
-    Map<TaskName, TaskInstance> tasks = new HashMap<>();
-    tasks.put(taskName0, t0);
-    tasks.put(taskName1, t1);
+    Map<TaskName, RunLoopTask> tasks = new HashMap<>();
+    tasks.put(taskName0, task0);
+    tasks.put(taskName1, task1);
 
     int maxMessagesInFlight = 1;
     RunLoop runLoop = new RunLoop(tasks, executor, consumerMultiplexer, 
maxMessagesInFlight, windowMs, commitMs,
                                             callbackTimeoutMs, 
maxThrottlingDelayMs, maxIdleMs, containerMetrics, () -> 0L, false);
     //have a null message in between to make sure task0 finishes processing 
and invoke the commit
     when(consumerMultiplexer.choose(false)).thenReturn(envelope0)
         .thenAnswer(x -> {
-            task0ProcessedMessagesLatch.await();
+//            task0ProcessedMessagesLatch.await();

Review comment:
       Resolving this as I've rewritten all tests to instead use mocks, and 
tried to clean up cruft I found along the way while doing that.




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