sjwiesman commented on a change in pull request #11980:
URL: https://github.com/apache/flink/pull/11980#discussion_r419393363



##########
File path: 
flink-libraries/flink-state-processing-api/src/test/java/org/apache/flink/state/api/output/KeyedStateBootstrapOperatorTest.java
##########
@@ -43,11 +48,53 @@
  */
 public class KeyedStateBootstrapOperatorTest {
 
-       private static final ValueStateDescriptor<Long> descriptor = new 
ValueStateDescriptor<Long>("state", Types.LONG);
+       private static final ValueStateDescriptor<Long> descriptor = new 
ValueStateDescriptor<>("state", Types.LONG);
+
+       private static final Long EVENT_TIMER = Long.MAX_VALUE - 1;
+
+       private static final Long PROC_TIMER = Long.MAX_VALUE - 2;
 
        @Rule
        public TemporaryFolder folder = new TemporaryFolder();
 
+       @Test
+       public void testTimerStateRestorable() throws Exception {
+               Path path = new Path(folder.newFolder().toURI());
+
+               OperatorSubtaskState state;
+               KeyedStateBootstrapOperator<Long, Long> bootstrapOperator = new 
KeyedStateBootstrapOperator<>(0L, path, new TimerBootstrapFunction());
+               try (KeyedOneInputStreamOperatorTestHarness<Long, Long, 
TaggedOperatorSubtaskState> harness = getHarness(bootstrapOperator)) {

Review comment:
       👍 

##########
File path: 
flink-libraries/flink-state-processing-api/src/test/java/org/apache/flink/state/api/output/KeyedStateBootstrapOperatorTest.java
##########
@@ -43,11 +48,53 @@
  */
 public class KeyedStateBootstrapOperatorTest {
 
-       private static final ValueStateDescriptor<Long> descriptor = new 
ValueStateDescriptor<Long>("state", Types.LONG);
+       private static final ValueStateDescriptor<Long> descriptor = new 
ValueStateDescriptor<>("state", Types.LONG);
+
+       private static final Long EVENT_TIMER = Long.MAX_VALUE - 1;
+
+       private static final Long PROC_TIMER = Long.MAX_VALUE - 2;
 
        @Rule
        public TemporaryFolder folder = new TemporaryFolder();
 
+       @Test
+       public void testTimerStateRestorable() throws Exception {
+               Path path = new Path(folder.newFolder().toURI());
+
+               OperatorSubtaskState state;
+               KeyedStateBootstrapOperator<Long, Long> bootstrapOperator = new 
KeyedStateBootstrapOperator<>(0L, path, new TimerBootstrapFunction());
+               try (KeyedOneInputStreamOperatorTestHarness<Long, Long, 
TaggedOperatorSubtaskState> harness = getHarness(bootstrapOperator)) {
+                       harness.open();
+
+                       harness.processElement(1L, 0L);
+                       harness.processElement(2L, 0L);
+                       harness.processElement(3L, 0L);
+                       bootstrapOperator.endInput();
+
+                       state = harness.extractOutputValues().get(0).state;
+               }
+
+               KeyedProcessOperator<Long, Long, Tuple3<Long, Long, 
TimeDomain>> procOperator = new KeyedProcessOperator<>(new 
SimpleProcessFunction());
+               try (KeyedOneInputStreamOperatorTestHarness<Long, Long, 
Tuple3<Long, Long, TimeDomain>> harness = getHarness(procOperator)) {

Review comment:
       👍 




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