From 1dbf91ab56e547a3b1ce77e44be8e3f8fe83fa2b Mon Sep 17 00:00:00 2001 From: Gao Binlong Date: Sat, 7 Oct 2023 21:07:39 +0800 Subject: [PATCH 1/2] Fix some test methods in SimulatePipelineRequestParsingTests never run and fix test failure Signed-off-by: Gao Binlong --- CHANGELOG.md | 1 + .../ingest/SimulatePipelineRequestParsingTests.java | 12 ++++++------ 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 4a039526d3664..bcc867f67c148 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -149,6 +149,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), - Fix circular dependency in Settings initialization ([10194](https://github.com/opensearch-project/OpenSearch/pull/10194)) - Fix registration and initialization of multiple extensions ([10256](https://github.com/opensearch-project/OpenSearch/pull/10256)) - Fix Segment Replication ShardLockObtainFailedException bug during index corruption ([10370](https://github.com/opensearch-project/OpenSearch/pull/10370)) +- Fix some test methods in SimulatePipelineRequestParsingTests never run and fix test failure ### Security diff --git a/server/src/test/java/org/opensearch/action/ingest/SimulatePipelineRequestParsingTests.java b/server/src/test/java/org/opensearch/action/ingest/SimulatePipelineRequestParsingTests.java index 04a9d08bb22bc..41f782e308785 100644 --- a/server/src/test/java/org/opensearch/action/ingest/SimulatePipelineRequestParsingTests.java +++ b/server/src/test/java/org/opensearch/action/ingest/SimulatePipelineRequestParsingTests.java @@ -85,7 +85,7 @@ public void init() throws IOException { when(ingestService.getProcessorFactories()).thenReturn(registry); } - public void testParseUsingPipelineStore(boolean useExplicitType) throws Exception { + public void testParseUsingPipelineStore() throws Exception { int numDocs = randomIntBetween(1, 10); Map requestContent = new HashMap<>(); @@ -131,7 +131,7 @@ public void testParseUsingPipelineStore(boolean useExplicitType) throws Exceptio assertThat(actualRequest.getPipeline().getProcessors().size(), equalTo(1)); } - public void innerTestParseWithProvidedPipeline() throws Exception { + public void testParseWithProvidedPipeline() throws Exception { int numDocs = randomIntBetween(1, 10); Map requestContent = new HashMap<>(); @@ -149,9 +149,9 @@ public void innerTestParseWithProvidedPipeline() throws Exception { doc.put(field.getFieldName(), value); expectedDoc.put(field.getFieldName(), value); } else { - Integer value = randomIntBetween(1, 1000000); + int value = randomIntBetween(1, 1000000); doc.put(field.getFieldName(), value); - expectedDoc.put(field.getFieldName(), value); + expectedDoc.put(field.getFieldName(), (long) value); } } else if (field == VERSION_TYPE) { String value = VersionType.toString(randomFrom(VersionType.INTERNAL, VersionType.EXTERNAL, VersionType.EXTERNAL_GTE)); @@ -163,9 +163,9 @@ public void innerTestParseWithProvidedPipeline() throws Exception { doc.put(field.getFieldName(), value); expectedDoc.put(field.getFieldName(), value); } else { - Integer value = randomIntBetween(1, 1000000); + int value = randomIntBetween(1, 1000000); doc.put(field.getFieldName(), value); - expectedDoc.put(field.getFieldName(), value); + expectedDoc.put(field.getFieldName(), (long) value); } } else { if (randomBoolean()) { From e2fad8462c9f702973b262f530c8632822b3c811 Mon Sep 17 00:00:00 2001 From: Gao Binlong Date: Sat, 7 Oct 2023 21:19:47 +0800 Subject: [PATCH 2/2] Modify changelog Signed-off-by: Gao Binlong --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index bcc867f67c148..ba71604d1a94e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -149,7 +149,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), - Fix circular dependency in Settings initialization ([10194](https://github.com/opensearch-project/OpenSearch/pull/10194)) - Fix registration and initialization of multiple extensions ([10256](https://github.com/opensearch-project/OpenSearch/pull/10256)) - Fix Segment Replication ShardLockObtainFailedException bug during index corruption ([10370](https://github.com/opensearch-project/OpenSearch/pull/10370)) -- Fix some test methods in SimulatePipelineRequestParsingTests never run and fix test failure +- Fix some test methods in SimulatePipelineRequestParsingTests never run and fix test failure ([#10496](https://github.com/opensearch-project/OpenSearch/pull/10496)) ### Security