-
Notifications
You must be signed in to change notification settings - Fork 59
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
control-service: handle init container OOM (#1658)
# Why Currently, if the init container fails with OOM the control service will mark the job as successful execution. # What Changed the CS logic to the following: if the init container fails with OOM the control service will mark the job as Platform Error. # Testing done Integration test Signed-off-by: Miroslav Ivanov [email protected] --------- Signed-off-by: Miroslav Ivanov [email protected] Co-authored-by: github-actions <>
- Loading branch information
1 parent
2b519ea
commit 785d5b3
Showing
10 changed files
with
187 additions
and
72 deletions.
There are no files selected for viewing
53 changes: 53 additions & 0 deletions
53
...ce/src/integration-test/java/com/vmware/taurus/datajobs/it/DataJobInitContainerOOMIT.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
/* | ||
* Copyright 2021-2023 VMware, Inc. | ||
* SPDX-License-Identifier: Apache-2.0 | ||
*/ | ||
|
||
package com.vmware.taurus.datajobs.it; | ||
|
||
import com.vmware.taurus.ControlplaneApplication; | ||
import com.vmware.taurus.controlplane.model.data.DataJobExecution; | ||
import com.vmware.taurus.datajobs.it.common.BaseIT; | ||
import com.vmware.taurus.datajobs.it.common.DataJobDeploymentExtension; | ||
import com.vmware.taurus.datajobs.it.common.JobExecutionUtil; | ||
import lombok.extern.slf4j.Slf4j; | ||
import org.apache.commons.lang3.tuple.ImmutablePair; | ||
import org.junit.jupiter.api.Test; | ||
import org.junit.jupiter.api.extension.RegisterExtension; | ||
import org.springframework.boot.test.context.SpringBootTest; | ||
import org.springframework.test.context.TestPropertySource; | ||
|
||
@Slf4j | ||
@TestPropertySource( | ||
properties = { | ||
"datajobs.deployment.initContainer.resources.requests.memory=6Mi", | ||
"datajobs.deployment.initContainer.resources.limits.memory=6Mi", | ||
}) | ||
@SpringBootTest( | ||
webEnvironment = SpringBootTest.WebEnvironment.RANDOM_PORT, | ||
classes = ControlplaneApplication.class) | ||
public class DataJobInitContainerOOMIT extends BaseIT { | ||
|
||
@RegisterExtension | ||
static DataJobDeploymentExtension dataJobDeploymentExtension = new DataJobDeploymentExtension(); | ||
|
||
@Test | ||
public void testDataJob_causesOOM_shouldCompleteWithUserError( | ||
String jobName, String teamName, String username, String deploymentId) throws Exception { | ||
// manually start job execution | ||
ImmutablePair<String, String> executeDataJobResult = | ||
JobExecutionUtil.executeDataJob(jobName, teamName, username, deploymentId, mockMvc); | ||
String opId = executeDataJobResult.getLeft(); | ||
String executionId = executeDataJobResult.getRight(); | ||
|
||
// Check the data job execution status | ||
JobExecutionUtil.checkDataJobExecutionStatus( | ||
executionId, | ||
DataJobExecution.StatusEnum.PLATFORM_ERROR, | ||
opId, | ||
jobName, | ||
teamName, | ||
username, | ||
mockMvc); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.