From bcd0351421a79b326624d440b76575fb43c7f0e9 Mon Sep 17 00:00:00 2001 From: Nicholas Walter Knize Date: Tue, 5 Apr 2022 00:00:26 -0500 Subject: [PATCH] Fix TaskInfo serialization and unmute task_list bwc test Fixes the version check around resourceStats serialization and unmutes the failing bwc test. Signed-off-by: Nicholas Walter Knize --- .../main/resources/rest-api-spec/test/tasks.list/10_basic.yml | 2 -- server/src/main/java/org/opensearch/tasks/TaskInfo.java | 4 ++-- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/rest-api-spec/src/main/resources/rest-api-spec/test/tasks.list/10_basic.yml b/rest-api-spec/src/main/resources/rest-api-spec/test/tasks.list/10_basic.yml index b1f2e084295a8..fd6bb7f96eb9d 100644 --- a/rest-api-spec/src/main/resources/rest-api-spec/test/tasks.list/10_basic.yml +++ b/rest-api-spec/src/main/resources/rest-api-spec/test/tasks.list/10_basic.yml @@ -1,8 +1,6 @@ --- "tasks_list test": - skip: - version: "all" - reason: "AwaitsFix https://github.com/opensearch-project/OpenSearch/issues/2757" features: [arbitrary_key] - do: diff --git a/server/src/main/java/org/opensearch/tasks/TaskInfo.java b/server/src/main/java/org/opensearch/tasks/TaskInfo.java index e6ba94a71b61d..b6814282b5db4 100644 --- a/server/src/main/java/org/opensearch/tasks/TaskInfo.java +++ b/server/src/main/java/org/opensearch/tasks/TaskInfo.java @@ -142,7 +142,7 @@ public TaskInfo(StreamInput in) throws IOException { } parentTaskId = TaskId.readFromStream(in); headers = in.readMap(StreamInput::readString, StreamInput::readString); - if (in.getVersion().onOrAfter(Version.V_2_0_0)) { + if (in.getVersion().onOrAfter(Version.V_2_1_0)) { resourceStats = in.readOptionalWriteable(TaskResourceStats::new); } else { resourceStats = null; @@ -164,7 +164,7 @@ public void writeTo(StreamOutput out) throws IOException { } parentTaskId.writeTo(out); out.writeMap(headers, StreamOutput::writeString, StreamOutput::writeString); - if (out.getVersion().onOrAfter(Version.V_2_0_0)) { + if (out.getVersion().onOrAfter(Version.V_2_1_0)) { out.writeOptionalWriteable(resourceStats); } }