Skip to content

Commit

Permalink
Merge pull request #28859 from vespa-engine/jonmv/resume-while-boosti…
Browse files Browse the repository at this point in the history
…ng-for-first-time-deployments

Verify warmup resume only initially in unit test
  • Loading branch information
freva authored Oct 10, 2023
2 parents 6cc74c4 + 656dcec commit abac62c
Showing 1 changed file with 18 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -730,6 +730,24 @@ void uncaps_and_caps_cpu_for_services_restart() {
inOrder.verify(orchestrator, times(1)).resume(eq(hostName));
}

@Test
void resume_during_first_warmup() {
InOrder inOrder = inOrder(orchestrator, nodeRepository);
NodeAgentImpl nodeAgent = makeNodeAgent(dockerImage, true, Duration.ofSeconds(30));
mockGetContainer(dockerImage, ContainerResources.from(2, 2, 16), true);

// Warmup period prevents resume when node has a current docker image, i.e., already existed.
nodeAgent.converge(createContext(nodeBuilder(NodeState.active).wantedDockerImage(dockerImage).currentDockerImage(dockerImage).build()));
inOrder.verifyNoMoreInteractions();

nodeAgent.converge(createContext(nodeBuilder(NodeState.active).wantedDockerImage(dockerImage).build()));
inOrder.verify(nodeRepository).updateNodeAttributes(eq(hostName), eq(new NodeAttributes().withDockerImage(dockerImage)
.withRebootGeneration(0)
.withVespaVersion(Version.fromString("7.1.1"))));
inOrder.verifyNoMoreInteractions();
}


@Test
void drop_all_documents() {
InOrder inOrder = inOrder(orchestrator, nodeRepository);
Expand Down

0 comments on commit abac62c

Please sign in to comment.