This is an automated email from the ASF dual-hosted git repository. xtsong pushed a commit to branch release-2.1 in repository https://gitbox.apache.org/repos/asf/flink.git
The following commit(s) were added to refs/heads/release-2.1 by this push: new 4fb312c8fe3 [FLINK-38098][Runtime] Fix JobClientHeartbeatRequestBody deserialization error 4fb312c8fe3 is described below commit 4fb312c8fe3cea8dce3f4ebe3ff2dfd1b715a005 Author: shilei <he...@qq.com> AuthorDate: Wed Jul 16 09:54:34 2025 +0800 [FLINK-38098][Runtime] Fix JobClientHeartbeatRequestBody deserialization error --- .../messages/JobClientHeartbeatRequestBody.java | 2 +- .../JobClientHeartbeatRequestBodyTest.java | 45 ++++++++++++++++++++++ 2 files changed, 46 insertions(+), 1 deletion(-) diff --git a/flink-runtime/src/main/java/org/apache/flink/runtime/rest/messages/JobClientHeartbeatRequestBody.java b/flink-runtime/src/main/java/org/apache/flink/runtime/rest/messages/JobClientHeartbeatRequestBody.java index d38cd5405c7..9e4d829a7ca 100644 --- a/flink-runtime/src/main/java/org/apache/flink/runtime/rest/messages/JobClientHeartbeatRequestBody.java +++ b/flink-runtime/src/main/java/org/apache/flink/runtime/rest/messages/JobClientHeartbeatRequestBody.java @@ -30,7 +30,7 @@ public class JobClientHeartbeatRequestBody implements RequestBody { private final long expiredTimestamp; @JsonCreator - public JobClientHeartbeatRequestBody(long expiredTimestamp) { + public JobClientHeartbeatRequestBody(@JsonProperty(EXPIRED_TIMESTAMP) long expiredTimestamp) { this.expiredTimestamp = expiredTimestamp; } diff --git a/flink-runtime/src/test/java/org/apache/flink/runtime/rest/messages/JobClientHeartbeatRequestBodyTest.java b/flink-runtime/src/test/java/org/apache/flink/runtime/rest/messages/JobClientHeartbeatRequestBodyTest.java new file mode 100644 index 00000000000..95f496cffb9 --- /dev/null +++ b/flink-runtime/src/test/java/org/apache/flink/runtime/rest/messages/JobClientHeartbeatRequestBodyTest.java @@ -0,0 +1,45 @@ +/* + * 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.rest.messages; + +import org.apache.flink.testutils.junit.extensions.parameterized.NoOpTestExtension; + +import org.junit.jupiter.api.extension.ExtendWith; + +import static org.assertj.core.api.Assertions.assertThat; + +@ExtendWith(NoOpTestExtension.class) +public class JobClientHeartbeatRequestBodyTest + extends RestRequestMarshallingTestBase<JobClientHeartbeatRequestBody> { + @Override + protected Class<JobClientHeartbeatRequestBody> getTestRequestClass() { + return JobClientHeartbeatRequestBody.class; + } + + @Override + protected JobClientHeartbeatRequestBody getTestRequestInstance() throws Exception { + return new JobClientHeartbeatRequestBody(System.currentTimeMillis()); + } + + @Override + protected void assertOriginalEqualsToUnmarshalled( + JobClientHeartbeatRequestBody expected, JobClientHeartbeatRequestBody actual) { + assertThat(expected.getExpiredTimestamp()).isEqualTo(actual.getExpiredTimestamp()); + } +}