Hello dear Flink team

We are rather new to Flink and having problems understanding how unit
testing works overall.
We want to test the* onTimer()* method after registering a timer in the
*processElement()* function. However, the *onTimer() *is never called.

We were investigating the documentation, blog posts, books, anything we
could find and collected a few questions/doubts that we would like your
input on:

1. We are using event time and when calling *testHarness.processElement. *The
function through TestHarness however requires a *timestamp*.
Is this *timestamp *supposed to be set as the *processingTimestamp*?
We are, however, interested in an *EventTimeFunction*, not a
*ProcessingTimerFunction.* Would it make sense in our use case to call
testHarness.processElement(event, event.getTimestamp())?

2. We have added a debug call to *ctx.currentWaterMark()* call in the
original *processElement* function but this always returns *Long.MIN value*
even though we call *processWaterMark* before the *processElement* call.

Is the *processWatermark *constrained in tests somehow?

We noticed there is also a *processBroadcastWatermark*. Is this necessary
when we are working with* KeyedProcessingFunctions? *Is it analogous to
*processBroadcastElement()*?

We are really excited about working with Flink, it is a great tool.
Great job!

We will be waiting for your input.
Thanks beforehand for your support.

Kind regards,
Gabriel Rodrigues

Reply via email to