Skip to content

Kafka streams with chained emitStrategy(onWindowClose) example does not work #588

@gregfichtenholtz-illumio

Description

Hi, I got this example by using the following prompt in Google:

  1. kafka streams unit testing with chained "emitStrategy"
  2. 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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions