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

ASF subversion and git services commented on LUCENE-9592:
---------------------------------------------------------

Commit 8c7b709c08662d396bd12b1e352db99bb489a7da in lucene-solr's branch 
refs/heads/master from Julie Tibshirani
[ https://gitbox.apache.org/repos/asf?p=lucene-solr.git;h=8c7b709 ]

LUCENE-9592: Loosen equality checks in TestVectorUtil. (#2084)

TestVectorUtil occasionally fails because of floating point errors. This
change slightly increases the epsilon in equality checks -- testing shows that
this will greatly decrease the chance of failure.

> TestVectorUtil can fail with assertion error
> --------------------------------------------
>
>                 Key: LUCENE-9592
>                 URL: https://issues.apache.org/jira/browse/LUCENE-9592
>             Project: Lucene - Core
>          Issue Type: Test
>            Reporter: Julie Tibshirani
>            Priority: Minor
>          Time Spent: 1h 50m
>  Remaining Estimate: 0h
>
> Example failure:
> {code:java}
>  java.lang.AssertionError: expected:<35.699527740478516> but 
> was:<35.69953918457031>java.lang.AssertionError: 
> expected:<35.699527740478516> but was:<35.69953918457031> at 
> __randomizedtesting.SeedInfo.seed([305701410F76FAD0:4797D77886281D68]:0) at 
> org.junit.Assert.fail(Assert.java:89) at 
> org.junit.Assert.failNotEquals(Assert.java:835) at 
> org.junit.Assert.assertEquals(Assert.java:555) at 
> org.junit.Assert.assertEquals(Assert.java:685) at 
> org.apache.lucene.util.TestVectorUtil.testSelfDotProduct(TestVectorUtil.java:28)
>  at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native 
> Method) at 
> java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
>  at 
> java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
>  at java.base/java.lang.reflect.Method.invoke(Method.java:567){code}
> Reproduce line: 
> {code:java}
> gradlew test --tests TestVectorUtil.testSelfDotProduct 
> -Dtests.seed=305701410F76FAD0 -Dtests.slow=true -Dtests.badapples=true 
> -Dtests.locale=ar-AE -Dtests.timezone=SystemV/MST7 -Dtests.asserts=true 
> -Dtests.file.encoding=UTF-8 {code}
> Perhaps the vector utility methods should work with doubles instead of floats 
> to avoid loss of precision.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to