fix test: wait duration could be exactly 1000 ms
Project: http://git-wip-us.apache.org/repos/asf/storm/repo Commit: http://git-wip-us.apache.org/repos/asf/storm/commit/f9890817 Tree: http://git-wip-us.apache.org/repos/asf/storm/tree/f9890817 Diff: http://git-wip-us.apache.org/repos/asf/storm/diff/f9890817 Branch: refs/heads/master Commit: f9890817884fa3c3592ee09e085c0cc58dc52149 Parents: 87f8fa1 Author: Jungtaek Lim <[email protected]> Authored: Fri Dec 4 08:16:31 2015 +0900 Committer: Jungtaek Lim <[email protected]> Committed: Fri Dec 4 08:16:31 2015 +0900 ---------------------------------------------------------------------- .../test/jvm/backtype/storm/utils/ShellBoltMessageQueueTest.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/storm/blob/f9890817/storm-core/test/jvm/backtype/storm/utils/ShellBoltMessageQueueTest.java ---------------------------------------------------------------------- diff --git a/storm-core/test/jvm/backtype/storm/utils/ShellBoltMessageQueueTest.java b/storm-core/test/jvm/backtype/storm/utils/ShellBoltMessageQueueTest.java index 229efa1..f77877f 100644 --- a/storm-core/test/jvm/backtype/storm/utils/ShellBoltMessageQueueTest.java +++ b/storm-core/test/jvm/backtype/storm/utils/ShellBoltMessageQueueTest.java @@ -50,9 +50,10 @@ public class ShellBoltMessageQueueTest extends TestCase { long start = System.currentTimeMillis(); Object msg = queue.poll(1, TimeUnit.SECONDS); long finish = System.currentTimeMillis(); + long waitDuration = finish - start; assertNull(msg); - assertTrue(finish - start > 1000); + assertTrue("wait duration should be equal or greater than 1000, current: " + waitDuration, waitDuration >= 1000); } @Test
