Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

flaky test: DefaultDnsClientTest.testQueryTimeout(RecordType) [3] recordType=SRV #2928

Closed
bryce-anderson opened this issue May 14, 2024 · 2 comments · Fixed by #2929
Closed
Labels
flaky tests Unit tests are flaky

Comments

@bryce-anderson
Copy link
Contributor

java.lang.AssertionError: 
Expected: a value equal to or greater than <500000000L>
     but: <498157800L> was less than <500000000L>
	at org.hamcrest.MatcherAssert.assertThat(MatcherAssert.java:20)
	at org.hamcrest.MatcherAssert.assertThat(MatcherAssert.java:6)
	at io.servicetalk.dns.discovery.netty.DefaultDnsClientTest.testTimeout(DefaultDnsClientTest.java:1277)
	at io.servicetalk.dns.discovery.netty.DefaultDnsClientTest.testQueryTimeout(DefaultDnsClientTest.java:1220)

https://github.com/apple/servicetalk/pull/2926/checks?check_run_id=24925458933

@bryce-anderson bryce-anderson added the flaky tests Unit tests are flaky label May 14, 2024
@bryce-anderson
Copy link
Contributor Author

Looks like the new DNS timeout tests (add here) are flaky. The use of System.nanoTime() doesn't guarantee that nanosecond resolution and it looks like we're falling pray to that noise.

@bryce-anderson
Copy link
Contributor Author

Another one: https://github.com/apple/servicetalk/actions/runs/9081908523/job/24956956453?pr=2925#step:7:1152

DefaultDnsClientTest > testResolutionTimeout(RecordType) > testResolutionTimeout(RecordType) [3] recordType=SRV FAILED
    java.lang.AssertionError: 
    Expected: a value equal to or greater than <500000000L>
         but: <499693602L> was less than <500000000L>
        at org.hamcrest.MatcherAssert.assertThat(MatcherAssert.java:20)
        at org.hamcrest.MatcherAssert.assertThat(MatcherAssert.java:6)
        at io.servicetalk.dns.discovery.netty.DefaultDnsClientTest.testTimeout(DefaultDnsClientTest.java:1277)
        at io.servicetalk.dns.discovery.netty.DefaultDnsClientTest.testResolutionTimeout(DefaultDnsClientTest.java:1226)

idelpivnitskiy added a commit to idelpivnitskiy/servicetalk that referenced this issue May 14, 2024
Motivation:

The `nanoTime()` check causes flakiness.

Fixes: apple#2928
idelpivnitskiy added a commit that referenced this issue May 14, 2024
Motivation:

The `nanoTime()` check causes flakiness.

Fixes: #2928
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
flaky tests Unit tests are flaky
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant