From 0cf7737beab1fc230faaafaf3cdc88cb53a81501 Mon Sep 17 00:00:00 2001 From: Ryan Ernst Date: Thu, 26 Jul 2018 16:08:28 -0700 Subject: [PATCH 1/2] Tests: Fix convert error tests to use fixed value The error tests for hex values previously used a random string of digits, but this could be a valid hex value. This commit changes these tests to use a fixed invalid hex value. closes #32370 --- .../elasticsearch/ingest/common/ConvertProcessorTests.java | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/modules/ingest-common/src/test/java/org/elasticsearch/ingest/common/ConvertProcessorTests.java b/modules/ingest-common/src/test/java/org/elasticsearch/ingest/common/ConvertProcessorTests.java index ae27c7850daf3..2b99958ce7089 100644 --- a/modules/ingest-common/src/test/java/org/elasticsearch/ingest/common/ConvertProcessorTests.java +++ b/modules/ingest-common/src/test/java/org/elasticsearch/ingest/common/ConvertProcessorTests.java @@ -67,10 +67,9 @@ public void testConvertIntLeadingZero() throws Exception { assertThat(ingestDocument.getFieldValue(fieldName, Integer.class), equalTo(10)); } - @AwaitsFix(bugUrl = "https://github.com/elastic/elasticsearch/issues/32370") public void testConvertIntHexError() { IngestDocument ingestDocument = RandomDocumentPicks.randomIngestDocument(random()); - String value = "0x" + randomAlphaOfLengthBetween(1, 10); + String value = "0xnotanumber"; String fieldName = RandomDocumentPicks.addRandomField(random(), ingestDocument, value); Processor processor = new ConvertProcessor(randomAlphaOfLength(10), fieldName, fieldName, Type.INTEGER, false); IllegalArgumentException e = expectThrows(IllegalArgumentException.class, () -> processor.execute(ingestDocument)); @@ -140,7 +139,7 @@ public void testConvertLongLeadingZero() throws Exception { public void testConvertLongHexError() { IngestDocument ingestDocument = RandomDocumentPicks.randomIngestDocument(random()); - String value = "0x" + randomAlphaOfLengthBetween(1, 10); + String value = "0xnotanumber"; String fieldName = RandomDocumentPicks.addRandomField(random(), ingestDocument, value); Processor processor = new ConvertProcessor(randomAlphaOfLength(10), fieldName, fieldName, Type.LONG, false); IllegalArgumentException e = expectThrows(IllegalArgumentException.class, () -> processor.execute(ingestDocument)); From 82b9da56fba0155d7afa11e6d4027beafddba218 Mon Sep 17 00:00:00 2001 From: Jason Tedor Date: Fri, 27 Jul 2018 08:57:45 -0400 Subject: [PATCH 2/2] Remove added awaits fix --- .../org/elasticsearch/ingest/common/ConvertProcessorTests.java | 1 - 1 file changed, 1 deletion(-) diff --git a/modules/ingest-common/src/test/java/org/elasticsearch/ingest/common/ConvertProcessorTests.java b/modules/ingest-common/src/test/java/org/elasticsearch/ingest/common/ConvertProcessorTests.java index fa27ac21e051b..34fd4ec27a3b3 100644 --- a/modules/ingest-common/src/test/java/org/elasticsearch/ingest/common/ConvertProcessorTests.java +++ b/modules/ingest-common/src/test/java/org/elasticsearch/ingest/common/ConvertProcessorTests.java @@ -137,7 +137,6 @@ public void testConvertLongLeadingZero() throws Exception { assertThat(ingestDocument.getFieldValue(fieldName, Long.class), equalTo(10L)); } - @AwaitsFix( bugUrl = "https://github.com/elastic/elasticsearch/issues/32370") public void testConvertLongHexError() { IngestDocument ingestDocument = RandomDocumentPicks.randomIngestDocument(random()); String value = "0xnotanumber";