-
Notifications
You must be signed in to change notification settings - Fork 25.6k
Closed
Labels
:Clients/Java Low Level REST ClientMinimal dependencies Java Client for ElasticsearchMinimal dependencies Java Client for Elasticsearch>test-failureTriaged test failures from CITriaged test failures from CIv6.4.2v6.7.0v7.0.0-beta1
Description
I see a variety of failures of the following form on the Windows compatibility tests:
Suite: org.elasticsearch.client.DeadHostStateTests
FAILURE 0.01s J0 | DeadHostStateTests.testCompareToDefaultTimeSupplier <<< FAILURES!
> Throwable #1: java.lang.AssertionError:
> Expected: a value less than <15864990105023L>
> but: <15864990105023L> was equal to <15864990105023L>
> at __randomizedtesting.SeedInfo.seed([CD210BC9F8F37963:56E027485D8503A0]:0)
> at org.hamcrest.MatcherAssert.assertThat(MatcherAssert.java:20)
> at org.hamcrest.MatcherAssert.assertThat(MatcherAssert.java:8)
> at org.elasticsearch.client.DeadHostStateTests.testCompareToDefaultTimeSupplier(DeadHostStateTests.java:67)
> at java.lang.Thread.run(Thread.java:748)
E.g.
The issue, I believe, is that we use DeadHostState.TimeSupplier.DEFAULT in the tests, which wrap System.getNanoTime(), and we assume that the value it returns increases between loop iterations. Each iteration likely takes more than 1ns but System.getNanoTime() is not so accurate, particularly on Windows, and this causes the tests to fail sometimes.
Marking this as @AwaitsFix since I think it'd be better to use our own time supplier throughout these tests rather than System.getNanoTime() here, and this seems to require a bit of rework.
Metadata
Metadata
Assignees
Labels
:Clients/Java Low Level REST ClientMinimal dependencies Java Client for ElasticsearchMinimal dependencies Java Client for Elasticsearch>test-failureTriaged test failures from CITriaged test failures from CIv6.4.2v6.7.0v7.0.0-beta1