eclipse / microprofile-rest-client

MicroProfile Rest Client
Apache License 2.0
141 stars 71 forks source link

TCK needs additional handling of some JVMs providing inaccurate results from `System.nanoTime` and `TimeUnit.convert` #303

Closed andymc12 closed 3 years ago

andymc12 commented 3 years ago

In some of the timeout tests, we're seeing that some JVMs are returning inaccurate results for System.nanoTime() resulting in timeouts that waited 7 seconds are reported as only having waited 6 seconds.

I'd like to propose two TCK changes: (1) Since we specify the timeout in milliseconds, I'd like to convert to milliseconds rather than seconds (currently, we configure the timeout to 7000ms, then check that the test waited >= 7 seconds - I want to make everything consistent and just use milliseconds). (2) I'd like to allow some buffer. So if we are expecting the timeout to be 7000ms, then I'd like the TCK to pass if the test waits for at least 6900ms to account for inaccuracies of the System.nanoTime() method and conversion/rounding/etc.