aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHåkon Hallingstad <hakon@yahoo-inc.com>2017-06-27 11:13:14 +0200
committerHåkon Hallingstad <hakon@yahoo-inc.com>2017-06-27 11:13:14 +0200
commit696b53aec5f0719dfeb7036870674351ea8f5c70 (patch)
treed02402324a82c05eb17e90a1f595696f01d7c5af
parent577a1cde5564ba34d42264526fcbdcdefa3d83c1 (diff)
Expand test to cover 2nd converge
-rw-r--r--node-admin/src/test/java/com/yahoo/vespa/hosted/node/admin/nodeagent/NodeAgentImplTest.java14
1 files changed, 11 insertions, 3 deletions
diff --git a/node-admin/src/test/java/com/yahoo/vespa/hosted/node/admin/nodeagent/NodeAgentImplTest.java b/node-admin/src/test/java/com/yahoo/vespa/hosted/node/admin/nodeagent/NodeAgentImplTest.java
index 00b776973e3..0f5721a5d75 100644
--- a/node-admin/src/test/java/com/yahoo/vespa/hosted/node/admin/nodeagent/NodeAgentImplTest.java
+++ b/node-admin/src/test/java/com/yahoo/vespa/hosted/node/admin/nodeagent/NodeAgentImplTest.java
@@ -117,10 +117,8 @@ public class NodeAgentImplTest {
verify(dockerOperations, never()).scheduleDownloadOfImage(eq(containerName), any(), any());
final InOrder inOrder = inOrder(dockerOperations, orchestrator, nodeRepository);
- // TODO: Verify this isn't run unless 1st time
- inOrder.verify(dockerOperations, times(1)).resumeNode(eq(containerName));
+ inOrder.verify(dockerOperations).resumeNode(eq(containerName));
inOrder.verify(orchestrator).resume(hostName);
- // TODO: This should not happen when nothing is changed. Now it happens 1st time through.
inOrder.verify(nodeRepository).updateNodeAttributes(
hostName,
new NodeAttributes()
@@ -135,7 +133,17 @@ public class NodeAgentImplTest {
verify(orchestrator, never()).suspend(any(String.class));
verify(dockerOperations, never()).scheduleDownloadOfImage(eq(containerName), any(), any());
+ // Should not be called 2nd time
+ inOrder.verify(dockerOperations, never()).resumeNode(eq(containerName));
inOrder.verify(orchestrator).resume(hostName);
+ // Should not be called 2nd time
+ inOrder.verify(nodeRepository, never()).updateNodeAttributes(
+ hostName,
+ new NodeAttributes()
+ .withRestartGeneration(restartGeneration)
+ .withRebootGeneration(rebootGeneration)
+ .withDockerImage(dockerImage)
+ .withVespaVersion(vespaVersion));
}
@Test