Fix BasicTaskExecutionTest.testScheduledTaskExecutedAfterDelay - Failed in buildhive with: (actualDelay=40) not greater than (delay=100 + earlyReturnGrace=25) - Fix is to start stopwatch before calling submit. Also increase "maxOverhead" to avoid similar errors in the other direction.
Project: http://git-wip-us.apache.org/repos/asf/brooklyn-server/repo Commit: http://git-wip-us.apache.org/repos/asf/brooklyn-server/commit/755d1ed2 Tree: http://git-wip-us.apache.org/repos/asf/brooklyn-server/tree/755d1ed2 Diff: http://git-wip-us.apache.org/repos/asf/brooklyn-server/diff/755d1ed2 Branch: refs/heads/0.5.0 Commit: 755d1ed262f61d35b43a14018b01bc050f2f86aa Parents: 24c3a4c Author: Aled Sage <[email protected]> Authored: Mon Apr 22 10:38:26 2013 +0100 Committer: Aled Sage <[email protected]> Committed: Wed May 1 21:28:33 2013 +0100 ---------------------------------------------------------------------- .../test/java/brooklyn/util/task/BasicTaskExecutionTest.groovy | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/brooklyn-server/blob/755d1ed2/core/src/test/java/brooklyn/util/task/BasicTaskExecutionTest.groovy ---------------------------------------------------------------------- diff --git a/core/src/test/java/brooklyn/util/task/BasicTaskExecutionTest.groovy b/core/src/test/java/brooklyn/util/task/BasicTaskExecutionTest.groovy index 669957e..c07960d 100644 --- a/core/src/test/java/brooklyn/util/task/BasicTaskExecutionTest.groovy +++ b/core/src/test/java/brooklyn/util/task/BasicTaskExecutionTest.groovy @@ -350,7 +350,7 @@ public class BasicTaskExecutionTest { @Test public void testScheduledTaskExecutedAfterDelay() { int delay = 100; - int maxOverhead = 250; + int maxOverhead = 500; int earlyReturnGrace = 25; // saw 13ms early return on jenkins! final CountDownLatch latch = new CountDownLatch(1); @@ -363,9 +363,9 @@ public class BasicTaskExecutionTest { }}; ScheduledTask t = new ScheduledTask(taskFactory).delay(delay); + Stopwatch stopwatch = new Stopwatch().start(); em.submit(t); - Stopwatch stopwatch = new Stopwatch().start(); assertTrue(latch.await(TIMEOUT_MS, TimeUnit.MILLISECONDS)); long actualDelay = stopwatch.elapsedMillis();
