diff options
author | Valerij Fredriksen <valerijf@oath.com> | 2019-01-10 14:29:52 +0100 |
---|---|---|
committer | Valerij Fredriksen <valerijf@oath.com> | 2019-01-10 14:29:52 +0100 |
commit | aaeabd1eb297db6a64b4fc013864304ab96e6ded (patch) | |
tree | 1c8600fe5ceb1fcd9b3acad07b970a17a8b2470a /node-admin | |
parent | 0e81d4e9cc14091d6f5dc4f6cadacf7fbec9da9c (diff) |
Increase timeout to 10s
Diffstat (limited to 'node-admin')
-rw-r--r-- | node-admin/src/test/java/com/yahoo/vespa/hosted/node/admin/nodeagent/NodeAgentContextManagerTest.java | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/node-admin/src/test/java/com/yahoo/vespa/hosted/node/admin/nodeagent/NodeAgentContextManagerTest.java b/node-admin/src/test/java/com/yahoo/vespa/hosted/node/admin/nodeagent/NodeAgentContextManagerTest.java index c560d0590a4..f32e3d91e34 100644 --- a/node-admin/src/test/java/com/yahoo/vespa/hosted/node/admin/nodeagent/NodeAgentContextManagerTest.java +++ b/node-admin/src/test/java/com/yahoo/vespa/hosted/node/admin/nodeagent/NodeAgentContextManagerTest.java @@ -17,11 +17,13 @@ import static org.junit.Assert.assertTrue; */ public class NodeAgentContextManagerTest { + private static final int TIMEOUT = 10_000; + private final Clock clock = Clock.systemUTC(); private final NodeAgentContext initialContext = generateContext(); private final NodeAgentContextManager manager = new NodeAgentContextManager(clock, initialContext); - @Test(timeout = 1000) + @Test(timeout = TIMEOUT) public void returns_immediately_if_next_context_is_ready() throws InterruptedException { NodeAgentContext context1 = generateContext(); manager.scheduleTickWith(context1); @@ -31,7 +33,7 @@ public class NodeAgentContextManagerTest { assertSame(context1, manager.currentContext()); } - @Test(timeout = 1000) + @Test(timeout = TIMEOUT) public void blocks_in_nextContext_until_one_is_scheduled() throws InterruptedException { AsyncExecutor<NodeAgentContext> async = new AsyncExecutor<>(manager::nextContext); assertFalse(async.response.isPresent()); @@ -46,7 +48,7 @@ public class NodeAgentContextManagerTest { assertFalse(async.exception.isPresent()); } - @Test(timeout = 1000) + @Test(timeout = TIMEOUT) public void blocks_in_nextContext_until_interrupt() throws InterruptedException { AsyncExecutor<NodeAgentContext> async = new AsyncExecutor<>(manager::nextContext); assertFalse(async.response.isPresent()); @@ -60,7 +62,7 @@ public class NodeAgentContextManagerTest { assertFalse(async.response.isPresent()); } - @Test(timeout = 1000) + @Test(timeout = TIMEOUT) public void setFrozen_does_not_block_with_no_timeout() throws InterruptedException { assertFalse(manager.setFrozen(false, Duration.ZERO)); @@ -72,7 +74,7 @@ public class NodeAgentContextManagerTest { assertTrue(manager.setFrozen(false, Duration.ZERO)); } - @Test(timeout = 1000) + @Test(timeout = TIMEOUT) public void setFrozen_blocks_at_least_for_duration_of_timeout() { long wantedDurationMillis = 100; long start = clock.millis(); @@ -82,7 +84,7 @@ public class NodeAgentContextManagerTest { assertTrue(actualDurationMillis >= wantedDurationMillis); } - @Test(timeout = 1000) + @Test(timeout = TIMEOUT) public void setFrozen_is_successful_if_converged_in_time() throws InterruptedException { AsyncExecutor<Boolean> async = new AsyncExecutor<>(() -> manager.setFrozen(false, Duration.ofMillis(500))); |