Skip to content

Commit

Permalink
Merge branch 'main' into copy-fix-file-settings-reprocess-it
Browse files Browse the repository at this point in the history
  • Loading branch information
elasticmachine authored Oct 30, 2024
2 parents 6cf6edb + c6f7827 commit a2f13be
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 6 deletions.
2 changes: 1 addition & 1 deletion docs/reference/landing-page.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@
<a href="https://www.elastic.co/guide/en/cloud/current/ec-cloud-ingest-data.html">Adding data to Elasticsearch</a>
</li>
<li>
<a href="https://www.elastic.co/guide/en/enterprise-search/current/connectors.html">Connectors</a>
<a href="es-connectors.html">Connectors</a>
</li>
<li>
<a href="https://www.elastic.co/guide/en/enterprise-search/current/crawler.html">Web crawler</a>
Expand Down
3 changes: 0 additions & 3 deletions muted-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -103,9 +103,6 @@ tests:
- class: org.elasticsearch.xpack.sql.qa.single_node.JdbcSqlSpecIT
method: test {case-functions.testUcaseInline3}
issue: https://github.com/elastic/elasticsearch/issues/112643
- class: org.elasticsearch.script.StatsSummaryTests
method: testEqualsAndHashCode
issue: https://github.com/elastic/elasticsearch/issues/112439
- class: org.elasticsearch.repositories.blobstore.testkit.analyze.HdfsRepositoryAnalysisRestIT
issue: https://github.com/elastic/elasticsearch/issues/112889
- class: org.elasticsearch.xpack.sql.qa.security.JdbcSqlSpecIT
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -75,9 +75,21 @@ public void testEqualsAndHashCode() {
assertThat(stats1, equalTo(stats2));
assertThat(stats1.hashCode(), equalTo(stats2.hashCode()));

// Accumulators with same sum, but different counts are not equals
stats1.accept(1);
stats1.accept(1);
stats2.accept(2);
assertThat(stats1.getSum(), equalTo(stats2.getSum()));
assertThat(stats1.getCount(), not(equalTo(stats2.getCount())));
assertThat(stats1, not(equalTo(stats2)));
assertThat(stats1.hashCode(), not(equalTo(stats2.hashCode())));

// Accumulators with different values are not equals
randomDoubles(randomIntBetween(0, 20)).forEach(stats1);
randomDoubles(randomIntBetween(0, 20)).forEach(stats2);
stats1.reset();
stats2.reset();
randomDoubles(randomIntBetween(1, 20)).forEach(stats1.andThen(v -> stats2.accept(v + randomDoubleBetween(0.0, 1.0, false))));
assertThat(stats1.getCount(), equalTo(stats2.getCount()));
assertThat(stats1.getSum(), not(equalTo(stats2.getSum())));
assertThat(stats1, not(equalTo(stats2)));
assertThat(stats1.hashCode(), not(equalTo(stats2.hashCode())));
}
Expand Down

0 comments on commit a2f13be

Please sign in to comment.