[prev in list] [next in list] [prev in thread] [next in thread] 

List:       lucene-dev
Subject:    [jira] [Commented] (LUCENE-8146) Unit tests using StringHelper fail with ExceptionInInitializerError
From:       "Dawid Weiss (JIRA)" <jira () apache ! org>
Date:       2018-01-31 20:12:00
Message-ID: JIRA.13135128.1517414337000.90209.1517429520065 () Atlassian ! JIRA
[Download RAW message or body]


    [ https://issues.apache.org/jira/browse/LUCENE-8146?page=com.atlassian.jira.plugin \
.system.issuetabpanels:comment-tabpanel&focusedCommentId=16347537#comment-16347537 ] 

Dawid Weiss commented on LUCENE-8146:
-------------------------------------

Btw. I agree with Robert that the simplest fix (for now at least) is to adjust \
StringUtils to what he suggested (this is consistent with what randomized runner does \
too).

https://github.com/randomizedtesting/randomizedtesting/blob/master/randomized-runner/src/main/java/com/carrotsearch/randomizedtesting/RandomizedRunner.java#L349


> Unit tests using StringHelper fail with ExceptionInInitializerError for maven \
>                 surefire >= 2.18
> ----------------------------------------------------------------------------------------------
>  
> Key: LUCENE-8146
> URL: https://issues.apache.org/jira/browse/LUCENE-8146
> Project: Lucene - Core
> Issue Type: Bug
> Affects Versions: 7.2.1
> Reporter: Julien Massenet
> Priority: Minor
> Attachments: LUCENE-8146-seed_issue.tar.gz, LUCENE-8146_v1.patch
> 
> 
> This happens when multiple conditions are met:
> * The client code is built with Maven
> * To execute its unit tests, the client code relies on the \
>                 {{maven-surefire-plugin}}, with a version greater than 2.17 (last \
>                 working version)
> * The client code uses the {{org.apache.lucene.util.StringHelper}} class (even \
>                 transitively)
> * The client is configured as with the standard Lucene maven build (i.e. it is \
> possible to fix the test seed using the {{tests.seed}} property) There was a change \
> in Surefire's behavior starting with 2.18: when a property is empty, instead of not \
> sending it to the test runner, it will be sent with an empty value. This behavior \
>                 can be observed with the attached sample project:
> * {{mvn test}}: fails with a {{java.lang.ExceptionInInitializerError}}
> * {{mvn test -Dtests.seed=123456}}: succeeds because the property is set to a real \
>                 value
> * {{mvn test -Dsurefire.version=2.17}}: succeeds because the surefire version is \
> lower than 2.18 Attached is a patch (built against \{{branch_7x}}) that centralizes \
> accesses to the {{tests.seed}} system property; it also makes sure that if it is \
> empty, it is treated as absent.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@lucene.apache.org
For additional commands, e-mail: dev-help@lucene.apache.org


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic