dawidwys commented on a change in pull request #16773:
URL: https://github.com/apache/flink/pull/16773#discussion_r701091129



##########
File path: 
flink-tests/src/test/java/org/apache/flink/runtime/operators/lifecycle/StopWithSavepointITCase.java
##########
@@ -0,0 +1,155 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *    http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.flink.runtime.operators.lifecycle;
+
+import org.apache.flink.api.common.state.CheckpointListener;
+import 
org.apache.flink.runtime.operators.lifecycle.event.CheckpointCompletedEvent;
+import org.apache.flink.runtime.operators.lifecycle.event.TestEvent;
+import 
org.apache.flink.runtime.operators.lifecycle.event.WatermarkReceivedEvent;
+import 
org.apache.flink.runtime.operators.lifecycle.graph.TestJobBuilders.TestingGraphBuilder;
+import 
org.apache.flink.runtime.operators.lifecycle.validation.DrainingValidator;
+import 
org.apache.flink.runtime.operators.lifecycle.validation.FinishingValidator;
+import 
org.apache.flink.runtime.operators.lifecycle.validation.SameCheckpointValidator;
+import org.apache.flink.runtime.state.StateSnapshotContext;
+import org.apache.flink.streaming.api.operators.AbstractStreamOperator;
+import org.apache.flink.streaming.api.operators.BoundedMultiInput;
+import org.apache.flink.streaming.api.operators.StreamOperator;
+import org.apache.flink.streaming.api.watermark.Watermark;
+import org.apache.flink.test.util.AbstractTestBase;
+import org.apache.flink.testutils.junit.SharedObjects;
+
+import org.junit.Rule;
+import org.junit.Test;
+import org.junit.rules.TemporaryFolder;
+import org.junit.runner.RunWith;
+import org.junit.runners.Parameterized;
+import org.junit.runners.Parameterized.Parameter;
+
+import java.util.List;
+
+import static 
org.apache.flink.runtime.operators.lifecycle.graph.TestJobBuilders.COMPLEX_GRAPH_BUILDER;
+import static 
org.apache.flink.runtime.operators.lifecycle.graph.TestJobBuilders.SIMPLE_GRAPH_BUILDER;
+import static 
org.apache.flink.runtime.operators.lifecycle.validation.TestJobDataFlowValidator.checkDataFlow;
+import static 
org.apache.flink.runtime.operators.lifecycle.validation.TestOperatorLifecycleValidator.checkOperatorsLifecycle;
+
+/**
+ * A test suite to check that the operator methods are called according to 
contract when the job is
+ * stopped with savepoint. The contract was refined in FLIP-147.
+ *
+ * <p>Checked assumptions:
+ *
+ * <ol>
+ *   <li>Downstream should only be "finished" after all of its the upstreams 
are
+ *   <li>Order of events when finishing an operator:
+ *       <ol>
+ *         <li>(last data element)
+ *         <li>{@link Watermark#MAX_WATERMARK MAX_WATERMARK} (if with drain)
+ *         <li>{@link BoundedMultiInput#endInput endInput} (if with drain)
+ *         <li>timer service quiesced
+ *         <li>{@link StreamOperator#finish() finish} (if with drain; support 
is planned for

Review comment:
       > support is planned for no-drain
   
   Has this changed? As far as I remember we do not want to call finish() for 
`no-drain`? @pnowojski 




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