mjsax commented on code in PR #20693:
URL: https://github.com/apache/kafka/pull/20693#discussion_r2501370694


##########
streams/src/test/java/org/apache/kafka/streams/processor/internals/StreamTaskTest.java:
##########
@@ -1599,6 +1605,70 @@ public void shouldBeRecordIdlingTimeIfSuspended() {
         assertThat("task is not idling", 
task.timeCurrentIdlingStarted().isEmpty());
     }
 
+    @Test
+    public void shouldLogNotReadyWhenStaleAfterThreshold() throws Exception {
+        when(stateManager.taskId()).thenReturn(taskId);
+        when(stateManager.taskType()).thenReturn(TaskType.ACTIVE);
+        
+        task = createStatelessTask(createConfig("100"));
+        task.initializeIfNeeded();
+        task.completeRestoration(noOpResetter -> { });
+
+        task.addRecords(partition1, 
singleton(getConsumerRecordWithOffsetAsTimestamp(partition1, 0)));
+        
+        // Set lastNotReadyLogTime to simulate staleness
+        final Field lastNotReadyLogTimeField = 
StreamTask.class.getDeclaredField("lastNotReadyLogTime");

Review Comment:
   Wondering if we should better add a package-private method to `StreamTask` 
allowing us to just set it? Using reflections is always ugly.



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

To unsubscribe, e-mail: [email protected]

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

Reply via email to