akalash commented on a change in pull request #18658: URL: https://github.com/apache/flink/pull/18658#discussion_r801731347
########## File path: flink-tests/src/test/java/org/apache/flink/test/checkpointing/RestoreUpgradedJobITCase.java ########## @@ -0,0 +1,419 @@ +/* + * 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.test.checkpointing; + +import org.apache.flink.api.common.functions.RichMapFunction; +import org.apache.flink.api.common.state.ListState; +import org.apache.flink.api.common.state.ListStateDescriptor; +import org.apache.flink.api.common.typeinfo.Types; +import org.apache.flink.configuration.Configuration; +import org.apache.flink.core.execution.JobClient; +import org.apache.flink.core.execution.SavepointFormatType; +import org.apache.flink.core.testutils.OneShotLatch; +import org.apache.flink.runtime.jobgraph.SavepointConfigOptions; +import org.apache.flink.runtime.state.FunctionInitializationContext; +import org.apache.flink.runtime.state.FunctionSnapshotContext; +import org.apache.flink.runtime.testutils.MiniClusterResourceConfiguration; +import org.apache.flink.streaming.api.checkpoint.CheckpointedFunction; +import org.apache.flink.streaming.api.environment.CheckpointConfig; +import org.apache.flink.streaming.api.environment.StreamExecutionEnvironment; +import org.apache.flink.streaming.api.functions.sink.SinkFunction; +import org.apache.flink.streaming.api.functions.source.SourceFunction; +import org.apache.flink.test.util.MiniClusterWithClientResource; +import org.apache.flink.testutils.junit.SharedObjects; +import org.apache.flink.testutils.junit.SharedReference; +import org.apache.flink.util.TestLogger; + +import org.jetbrains.annotations.NotNull; +import org.junit.ClassRule; +import org.junit.Rule; +import org.junit.Test; +import org.junit.rules.TemporaryFolder; +import org.junit.runner.RunWith; +import org.junit.runners.Parameterized; + +import java.util.Iterator; +import java.util.concurrent.ExecutionException; +import java.util.concurrent.atomic.AtomicLong; +import java.util.concurrent.locks.LockSupport; + +import static org.apache.flink.runtime.testutils.CommonTestUtils.waitForAllTaskRunning; +import static org.apache.flink.test.checkpointing.RestoreUpgradedJobITCase.MapName.MAP_1; +import static org.apache.flink.test.checkpointing.RestoreUpgradedJobITCase.MapName.MAP_2; +import static org.apache.flink.test.checkpointing.RestoreUpgradedJobITCase.MapName.MAP_3; +import static org.apache.flink.test.checkpointing.RestoreUpgradedJobITCase.MapName.MAP_4; +import static org.apache.flink.test.checkpointing.RestoreUpgradedJobITCase.MapName.MAP_5; +import static org.apache.flink.test.checkpointing.RestoreUpgradedJobITCase.MapName.MAP_6; +import static org.apache.flink.test.checkpointing.RestoreUpgradedJobITCase.TestCheckpointType.ALIGNED_CHECKPOINT; +import static org.apache.flink.test.checkpointing.RestoreUpgradedJobITCase.TestCheckpointType.CANONICAL_SAVEPOINT; +import static org.apache.flink.test.checkpointing.RestoreUpgradedJobITCase.TestCheckpointType.NATIVE_SAVEPOINT; +import static org.hamcrest.MatcherAssert.assertThat; +import static org.hamcrest.Matchers.is; + +/** + * Test check scenario when the upgraded job(different map order, different record type, new map) + * restored on old savepoint/checkpoint. + */ +@RunWith(Parameterized.class) +public class RestoreUpgradedJobITCase extends TestLogger { + private static final int PARALLELISM = 3; + private static final int TOTAL_RECORDS = 100; + + @ClassRule public static TemporaryFolder temporaryFolder = new TemporaryFolder(); + @Parameterized.Parameter public TestCheckpointType checkpointType; + + @ClassRule + public static final MiniClusterWithClientResource CLUSTER = + new MiniClusterWithClientResource( + new MiniClusterResourceConfiguration.Builder() + .setConfiguration(new Configuration()) + .setNumberTaskManagers(2) + .setNumberSlotsPerTaskManager(10) Review comment: I use parallelism 4 right now but 2 slots are not enough since I use an extra sharing group now. So it works only with 4 slots. -- 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]
