You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@lucene.apache.org by "easyice (via GitHub)" <gi...@apache.org> on 2024/05/29 12:00:01 UTC
[PR] Fix test failure on TestPoint#testEqualsAndHashCode [lucene]
easyice opened a new pull request, #13433:
URL: https://github.com/apache/lucene/pull/13433
If two objects are different, it might have the same hashcode. in this case, `Point(-180.0,90.0)` and `Point(180.0,-90.0)` will have the same hashcode value.
```
org.apache.lucene.geo.TestPoint > testEqualsAndHashCode FAILED
java.lang.AssertionError: Values should be different. Actual: -1965031424
at __randomizedtesting.SeedInfo.seed([ADA73B977A63C061:DE69C35A79C6BF50]:0)
at org.junit.Assert.fail(Assert.java:89)
at org.junit.Assert.failEquals(Assert.java:187)
at org.junit.Assert.assertNotEquals(Assert.java:201)
at org.junit.Assert.assertNotEquals(Assert.java:213)
at org.apache.lucene.geo.TestPoint.testEqualsAndHashCode(TestPoint.java:59)
```
```
./gradlew :lucene:core:test --tests "org.apache.lucene.geo.TestPoint.testEqualsAndHashCode" -Ptests.seed=ADA73B977A63C061
```
We had similar issues in the other tests like `TestCircle#testEqualsAndHashCode`, `TestXYPolygon#testEqualsAndHashCode`. it seems it also needs to be removed. for random values, the hash code must be different is a wrong assumption.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@lucene.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@lucene.apache.org
For additional commands, e-mail: issues-help@lucene.apache.org
Re: [PR] Fix test failure on TestPoint#testEqualsAndHashCode [lucene]
Posted by "easyice (via GitHub)" <gi...@apache.org>.
easyice commented on PR #13433:
URL: https://github.com/apache/lucene/pull/13433#issuecomment-2139548520
Maybe we don't need to fix the other tests right now, unless they really encounter hash collisions.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@lucene.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@lucene.apache.org
For additional commands, e-mail: issues-help@lucene.apache.org
Re: [PR] Fix test failure on TestPoint#testEqualsAndHashCode [lucene]
Posted by "easyice (via GitHub)" <gi...@apache.org>.
easyice commented on PR #13433:
URL: https://github.com/apache/lucene/pull/13433#issuecomment-2144176070
Thanks for reviewing, Mike!
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@lucene.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@lucene.apache.org
For additional commands, e-mail: issues-help@lucene.apache.org
Re: [PR] Fix test failure on TestPoint#testEqualsAndHashCode [lucene]
Posted by "easyice (via GitHub)" <gi...@apache.org>.
easyice merged PR #13433:
URL: https://github.com/apache/lucene/pull/13433
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@lucene.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@lucene.apache.org
For additional commands, e-mail: issues-help@lucene.apache.org