elasticsearch icon indicating copy to clipboard operation
elasticsearch copied to clipboard

InternalCardinalityTests#testEqualsAndHashcode failure

Open iverase opened this issue 5 years ago • 4 comments

The failure can easily be reproduce with:

 ./gradlew ':server:test' --tests "org.elasticsearch.search.aggregations.metrics.InternalCardinalityTests.testEqualsAndHashcode" -Dtests.seed=7FFFBA60D5055C4B -Dtests.security.manager=true -Dtests.locale=ar-EG -Dtests.timezone=Europe/Saratov -Druntime.java=11

And the error looks like:

  2> java.lang.AssertionError: InternalCardinality mutation should not be equal to original
    Expected: not <{"fmTtJ":{"meta":{"RPdFM":"Bglpg","VLYUl":"qWMAU"},"value":50}}>
         but: was <{"fmTtJ":{"meta":{"RPdFM":"Bglpg","VLYUl":"qWMAU"},"value":50}}>
        at __randomizedtesting.SeedInfo.seed([7FFFBA60D5055C4B:EF0C2AD1AE21564]:0)

I had a look and the problem is as follows. Before #62480 for testing equality we were ignoring the provided bucket and were generating a string that was generated by all the elements in the runLens array. From now on we are only considering the runLens in the bucket (which I think is the right thing).

The test is mutating a HyperLogLog++ by adding new elements, unfortunately the values did not change so the resulting sketch is the same as the previous one. Before it did not fail because the original HyperLogLog++ contained more buckets.

iverase avatar Sep 17 '20 12:09 iverase

Pinging @elastic/es-analytics-geo (:Analytics/Aggregations)

elasticmachine avatar Sep 17 '20 12:09 elasticmachine

Another failure: https://gradle-enterprise.elastic.co/s/uh4n5sxuh2e2e/tests/task/:server:test/details/org.elasticsearch.search.aggregations.metrics.InternalCardinalityTests/testEqualsAndHashcode?expanded-stacktrace=WyIwIl0&top-execution=1

jonathan-buttner avatar Apr 15 '24 20:04 jonathan-buttner

Pinging @elastic/es-analytical-engine (Team:Analytics)

elasticsearchmachine avatar Apr 26 '24 17:04 elasticsearchmachine

Let's open a new issue next time so we keep the message:

REPRODUCE WITH: ./gradlew ':server:test' --tests "org.elasticsearch.search.aggregations.metrics.InternalCardinalityTests.testEqualsAndHashcode" -Dtests.seed=F7FC01BCB312DEE5 -Dtests.locale=mt -Dtests.timezone=Africa/Douala -Druntime.java=21

org.elasticsearch.search.aggregations.metrics.InternalCardinalityTests > testEqualsAndHashcode FAILED
    java.lang.AssertionError: InternalCardinality mutation should not be equal to original
    Expected: not <{"tZZpk":{"value":11}}>
         but: was <{"tZZpk":{"value":11}}>
        at __randomizedtesting.SeedInfo.seed([F7FC01BCB312DEE5:86F379717CF597CA]:0)
        at org.hamcrest.MatcherAssert.assertThat(MatcherAssert.java:18)
        at org.junit.Assert.assertThat(Assert.java:964)
        at org.elasticsearch.test.EqualsHashCodeTestUtils.checkEqualsAndHashCode(EqualsHashCodeTestUtils.java:95)
        at org.elasticsearch.test.AbstractWireTestCase.testEqualsAndHashcode(AbstractWireTestCase.java:60)
        at java.base/jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:103)
        at java.base/java.lang.reflect.Method.invoke(Method.java:580)
        at com.carrotsearch.randomizedtesting.RandomizedRunner.invoke(RandomizedRunner.java:1758)
        at com.carrotsearch.randomizedtesting.RandomizedRunner$8.evaluate(RandomizedRunner.java:946)
        at com.carrotsearch.randomizedtesting.RandomizedRunner$9.evaluate(RandomizedRunner.java:982)
        at com.carrotsearch.randomizedtesting.RandomizedRunner$10.evaluate(RandomizedRunner.java:996)

iverase avatar Apr 26 '24 17:04 iverase