Intermittent test failure on SQSErrorRetryHandlerTest.testQueueDeletedRecentlyRetriesWhen59SleepsAndTries

3 views
Skip to first unread message

Andrew Phillips

unread,
Sep 16, 2012, 5:31:05 AM9/16/12
to jclou...@googlegroups.com
I'm seeing intermittent test failures in
SQSErrorRetryHandlerTest.testQueueDeletedRecentlyRetriesWhen59SleepsAndTries
on Windows, where

watch.stop().elapsedTime(TimeUnit.MILLISECONDS)

returns 99 even though the method is expected to sleep for 100ms or
more. Guess this is due to the "precision and accuracy of system
timers and schedulers" referred to in the docs [1].

Would it make sense to relax the assertion to something like

// allow for slightly inaccurate system timers
assertTrue(elapsedTime >= 98);

in order to deal with this?

ap

[1] http://docs.oracle.com/javase/6/docs/api/java/lang/Thread.html#sleep(long)

Adrian Cole

unread,
Sep 16, 2012, 12:43:58 PM9/16/12
to jclou...@googlegroups.com, aphi...@qrmedia.com
+1

Andrew Phillips

unread,
Sep 16, 2012, 1:36:55 PM9/16/12
to jclou...@googlegroups.com

Adrian Cole

unread,
Sep 16, 2012, 5:05:59 PM9/16/12
to jclou...@googlegroups.com, aphi...@qrmedia.com
Thanks, Andrew!

On Sunday, September 16, 2012 10:36:56 AM UTC-7, Andrew Phillips wrote:
> +1

https://github.com/jclouds/jclouds/commit/085bc43d4883e359a0966a0b2e7a3a9f617c705a

ap
Reply all
Reply to author
Forward
0 new messages