From 06b7f9c78e10888c0214e9835fb0da2bc60bf486 Mon Sep 17 00:00:00 2001 From: Adrien Grand Date: Wed, 30 Aug 2017 09:46:37 +0200 Subject: [PATCH] Do not test the ingest date processor against random locales. Random locales include locales whose country name is obsolete like `CS` or have usage restrictions like `DG`. Closes #26425 --- .../ingest/common/DateProcessorFactoryTests.java | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/modules/ingest-common/src/test/java/org/elasticsearch/ingest/common/DateProcessorFactoryTests.java b/modules/ingest-common/src/test/java/org/elasticsearch/ingest/common/DateProcessorFactoryTests.java index d98749b845d..6bb3887f670 100644 --- a/modules/ingest-common/src/test/java/org/elasticsearch/ingest/common/DateProcessorFactoryTests.java +++ b/modules/ingest-common/src/test/java/org/elasticsearch/ingest/common/DateProcessorFactoryTests.java @@ -81,14 +81,13 @@ public class DateProcessorFactoryTests extends ESTestCase { } } - @AwaitsFix(bugUrl = "https://github.com/elastic/elasticsearch/issues/26425") public void testParseLocale() throws Exception { DateProcessor.Factory factory = new DateProcessor.Factory(); Map config = new HashMap<>(); String sourceField = randomAlphaOfLengthBetween(1, 10); config.put("field", sourceField); config.put("formats", Collections.singletonList("dd/MM/yyyyy")); - Locale locale = randomLocale(random()); + Locale locale = randomFrom(Locale.GERMANY, Locale.FRENCH, Locale.ROOT); config.put("locale", locale.toLanguageTag()); DateProcessor processor = factory.create(null, null, config); @@ -96,7 +95,7 @@ public class DateProcessorFactoryTests extends ESTestCase { } public void testParseInvalidLocale() throws Exception { - String[] locales = new String[] { "invalid_locale", "english" }; + String[] locales = new String[] { "invalid_locale", "english", "xy", "en-XY" }; for (String locale : locales) { DateProcessor.Factory factory = new DateProcessor.Factory(); Map config = new HashMap<>();