[ 
https://issues.apache.org/jira/browse/SOLR-17379?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17868818#comment-17868818
 ] 

Chris M. Hostetter commented on SOLR-17379:
-------------------------------------------

{quote}+1 thanks
{quote}
I'm not sure I understand what you're "+1"ing, since the french test is still 
very broken : )

I'm also more and more convinced that there is something weird going on here 
that somebody smarter then me is going to need to figure out...
 
----
 
(Note: all commands in this comment were run using jdk21)

Uwe made a comment on the mailing list suggesting that maybe the CLDR data had 
changed, and we should use the "parser" to format the expected Instant, and 
then update the test to use that string.  When I attempted to do just that my 
jshell script, I got the same String the test already uses {{{}"le vendredi 15 
janvier 2010"{}}}. Starting to theorize that maybe the way jshell works my {{-R 
-Djava.locale.providers=CLDR}} was setting the ssyproperty too late to 
influence the locale loading, I tried again using a little {{Tmp.java}} ...
{noformat}
hossman@slate:~/tmp$ cat Tmp.java 
public class Tmp {
  public static void main(String[] args) {
    System.out.println
      (
        new java.time.format.DateTimeFormatterBuilder()
        .parseLenient()
        .parseCaseInsensitive()
        .appendPattern("'le' EEEE dd MMMM yyyy")
        .toFormatter(org.apache.commons.lang3.LocaleUtils.toLocale("fr"))
        .withResolverStyle(java.time.format.ResolverStyle.LENIENT)
        .withZone(java.time.ZoneId.of("UTC"))
        .format(java.time.Instant.parse("2010-01-15T00:00:00.000Z"))
      );
  }
}
hossman@slate:~/tmp$ javac -cp 
/home/hossman/.gradle/caches/modules-2/files-2.1/org.apache.commons/commons-lang3/3.15.0/21581109b4be710ea4b195d5760392ec284f9f11/commons-lang3-3.15.0.jar
 Tmp.java 
hossman@slate:~/tmp$ java -Djava.locale.providers=CLDR -cp 
/home/hossman/.gradle/caches/modules-2/files-2.1/org.apache.commons/commons-lang3/3.15.0/21581109b4be710ea4b195d5760392ec284f9f11/commons-lang3-3.15.0.jar:.
 Tmp
le vendredi 15 janvier 2010
{noformat}
So then as a hail mary I tried adding this to logging to where 
ParseDateFieldUpdateProcessorFactory initializes the parsers...
{noformat}
        log.debug("nocommit: {}={} + {}={} + {} => {}",
                  localeParam, locale,
                  defaultTimeZoneParam, defaultTimeZone,
                  value, 
formatter.format(java.time.Instant.parse("2010-01-15T00:00:00.000Z")));
{noformat}
Lo and behold...
{noformat}
$ gradle test --tests ParsingFieldUpdateProcessorsTest.testParseFrenchDate 
-Ptests.verbose=true -Ptests.locale=fr -Ptests.timezone=Americas/Metlakatla 
-Ptests.jvmargs="-Djava.locale.providers=CLDR -XX:TieredStopAtLevel=1 
-XX:+UseParallelGC -XX:ActiveProcessorCount=1 -XX:ReservedCodeCacheSize=120m"
...
  2> 2838 DEBUG (coreLoadExecutor-14-thread-1) [n: c: s: r: x:collection1 t:] 
o.a.s.u.p.ParseDateFieldUpdateProcessorFactory nocommit: fr=fr + UTC=UTC + 'le' 
EEEE dd MMMM yyyy => le Fri 15 Jan 2010
...
BUILD FAILED in 33s
{noformat}
...vs...
{noformat}
gradle test --tests ParsingFieldUpdateProcessorsTest.testParseFrenchDate 
-Ptests.verbose=true -Ptests.locale=fr -Ptests.timezone=Americas/Metlakatla 
-Ptests.jvmargs="-XX:TieredStopAtLevel=1 -XX:+UseParallelGC 
-XX:ActiveProcessorCount=1 -XX:ReservedCodeCacheSize=120m"
...
  2> 3315 DEBUG (coreLoadExecutor-14-thread-1) [n: c: s: r: x:collection1 t:] 
o.a.s.u.p.ParseDateFieldUpdateProcessorFactory nocommit: fr=fr + UTC=UTC + 'le' 
EEEE dd MMMM yyyy => le vendredi 15 janvier 2010
...
BUILD SUCCESSFUL in 19s
{noformat}
...which confuses the fuck out of me in so many ways...
 # what is it about Solr (or the test framework) that causes the behavior of 
the DateTimeFormatter used in Solr to differ from the one in my {{Tmp.java}} 
when formatting this Instant when using {{java.locale.providers=CLDR}}
 # Why is the DateTimeFormatter using english {{Fri}} and {{Jan}} instead of 
the french basaed on it's Locale?
 ** Even if it was based on the default locale, as you can see i tried setting 
that to {{"fr"}} as well
 # Even if english was correct – why the abbreviated forms????
 ** the pattern uses {{EEEE}} and {{MMMM}} – those are suppose to both be 
{{TextStyle.FULL}} !

> ParsingFieldUpdateProcessorsTest failures using CLDR locale provider
> --------------------------------------------------------------------
>
>                 Key: SOLR-17379
>                 URL: https://issues.apache.org/jira/browse/SOLR-17379
>             Project: Solr
>          Issue Type: Test
>      Security Level: Public(Default Security Level. Issues are Public) 
>            Reporter: Chris M. Hostetter
>            Priority: Major
>         Attachments: SOLR-17379.test.patch
>
>
> Background: https://lists.apache.org/thread/o7xwz8df6j0bx7w2m3w8ptrp4r7q957n
> Test failures from {{ParsingFieldUpdateProcessorsTest.testAKSTZone}} and 
> {{ParsingFieldUpdateProcessorsTest.testParseFrenchDate}} are seemingly 
> guaranteed on JDK23, due to the removal of the {{COMPAT}} local provider 
> option.
> On (some) earlier JDKs, these failures can be reproduced using...
> {noformat}
> ./gradlew test --tests ParsingFieldUpdateProcessorsTest  
> -Ptests.jvmargs="-Djava.locale.providers=CLDR -XX:TieredStopAtLevel=1 
> -XX:+UseParallelGC -XX:ActiveProcessorCount=1 -XX:ReservedCodeCacheSize=120m"
> {noformat}
> ...to force the use off {{CLDR}} and exclude the use of {{COMPAT}}



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscr...@solr.apache.org
For additional commands, e-mail: issues-h...@solr.apache.org

Reply via email to