[ 
https://issues.apache.org/jira/browse/KAFKA-19810?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=18031272#comment-18031272
 ] 

Matthias J. Sax edited comment on KAFKA-19810 at 10/20/25 11:26 PM:
--------------------------------------------------------------------

The record you use to close the "second window" (ie, `inputTopic.pipeInput("D", 
"value6", secondWindowCloseTime);`) will be processed by the first window, and 
will get "stuck there". It does open a new 1-minute window [10:07; 10:08) which 
is still open, and thus no result is emitted. Hence, the time for the second 
windowed-aggregation does not advance to `10:07` and it's own window [10:00; 
10:05) does not close yet.


was (Author: mjsax):
The record you use to close the "second window" (ie, `inputTopic.pipeInput("D", 
"value6", secondWindowCloseTime);`) will be processed by the first window, and 
will get "stuck there". It does open a new 1-minute window [10:07; 10:08) which 
is still open, and thus not result is emitted. Hence, the time for the second 
windowed-aggregation does not advance to `10:07` and it's own window [10:00; 
10:05) does not close yet.

> Kafka streams with chained emitStrategy(onWindowClose) example does not work
> ----------------------------------------------------------------------------
>
>                 Key: KAFKA-19810
>                 URL: https://issues.apache.org/jira/browse/KAFKA-19810
>             Project: Kafka
>          Issue Type: Bug
>          Components: streams
>            Reporter: Greg F
>            Priority: Major
>
> Hi, I got this example by using the following prompt in Google:
>  # kafka streams unit testing with chained "emitStrategy"
>  # Provide an example of testing chained suppress with different grace periods
> [https://gist.github.com/gregfichtenholtz-illumio/81fb537e24f7187e9de37686bb8eca7d]
> Compiled and ran the example using latest kafka jars only to get
> [ERROR] Tests run: 1, Failures: 1, Errors: 0, Skipped: 0, Time elapsed: 1.103 
> s <<< FAILURE! -- in com.k8sflowprocessor.ChainedEmitStrategyTopologyTest
> [ERROR] 
> com.foo.bar.ChainedEmitStrategyTopologyTest.testChainedWindowedAggregationsWithDifferentGracePeriods
>  -- Time elapsed: 1.096 s <<< FAILURE!
> org.opentest4j.AssertionFailedError: Final output should contain one result 
> ==> expected: <1> but was: <0>
> at 
> org.junit.jupiter.api.AssertionFailureBuilder.build(AssertionFailureBuilder.java:158)
> at 
> org.junit.jupiter.api.AssertionFailureBuilder.buildAndThrow(AssertionFailureBuilder.java:139)
> at org.junit.jupiter.api.AssertEquals.failNotEqual(AssertEquals.java:201)
> at org.junit.jupiter.api.AssertEquals.assertEquals(AssertEquals.java:168)
> at org.junit.jupiter.api.Assertions.assertEquals(Assertions.java:694)
> at 
> com.foo.bar.ChainedEmitStrategyTopologyTest.testChainedWindowedAggregationsWithDifferentGracePeriods(ChainedEmitStrategyTopologyTest.java:123)
> It appears that the test is not able to drive the kafka stream to emit the 
> 2nd event.
> Could be a bug in test code/test driver/kafka streams?
> Thanks in advance
> Greg
>  



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to