artiya4u / google-http-java-client

Automatically exported from code.google.com/p/google-http-java-client
0 stars 0 forks source link

NanoClock #181

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
External references, such as a standards document, or specification?

http://javadoc.google-http-java-client.googlecode.com/hg/1.12.0-beta/com/google/
api/client/util/Clock.html

Java environments (e.g. Java 6, Android 2.3, App Engine, or All)?

All

Please describe the feature requested.

To improve testing, we need a version of Clock that works on System.nanoTime() 
instead of currentTimeMillis().

Original issue reported on code.google.com by yan...@google.com on 18 Dec 2012 at 1:49

GoogleCodeExporter commented 9 years ago
Specifically, we need NanoClock for the implementation of 
ExponentialBackOffPolicy.

This is rare, but I actually got this test failure:

junit.framework.AssertionFailedError: expected:<-1> but was:<1067>
    at junit.framework.Assert.fail(Assert.java:47)
    at junit.framework.Assert.failNotEquals(Assert.java:283)
    at junit.framework.Assert.assertEquals(Assert.java:64)
    at junit.framework.Assert.assertEquals(Assert.java:130)
    at junit.framework.Assert.assertEquals(Assert.java:136)
    at com.google.api.client.http.ExponentialBackOffPolicyTest.testMaxElapsedTime(ExponentialBackOffPolicyTest.java:158)

Perhaps we can write this test better if we had NanoClock.

Original comment by yan...@google.com on 18 Dec 2012 at 1:51

GoogleCodeExporter commented 9 years ago
https://codereview.appspot.com/7095045/

Original comment by yan...@google.com on 11 Jan 2013 at 10:51

GoogleCodeExporter commented 9 years ago

Original comment by yan...@google.com on 14 Jan 2013 at 9:38