-
Notifications
You must be signed in to change notification settings - Fork 65
control-service: killed job was shown as successful #2116
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
mivanov1988
merged 9 commits into
main
from
person/miroslavi/killed-job-was-shown-as-successful2
May 25, 2023
Merged
Changes from all commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
5e22e78
control-service: killed job was shown as successful
mivanov1988 1d211f3
Fixed test
mivanov1988 aed4af6
Refactored the code
mivanov1988 b8e54cc
Google Java Format
fc330c1
Refactored the code
mivanov1988 389e238
Google Java Format
bd39be3
Refactored the code
mivanov1988 fd2e117
Google Java Format
0ca9cc9
Refactored the code
mivanov1988 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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
70 changes: 70 additions & 0 deletions
70
...ntegration-test/java/com/vmware/taurus/datajobs/it/TestDataJobBackoffLimitExceededIT.java
This file contains hidden or 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,70 @@ | ||
| /* | ||
| * 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 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; | ||
|
|
||
| import static com.vmware.taurus.datajobs.it.common.JobExecutionUtil.*; | ||
|
|
||
| @Slf4j | ||
| @TestPropertySource( | ||
| properties = { | ||
| // This is a standard cron job template except activeDeadlineSeconds is set to 1 | ||
| "datajobs.control.k8s.data.job.template.file=data_job_templates/backoff_limit_exceeded_cron_job.yaml" | ||
| }) | ||
| @SpringBootTest( | ||
| webEnvironment = SpringBootTest.WebEnvironment.RANDOM_PORT, | ||
| classes = ControlplaneApplication.class) | ||
| public class TestDataJobBackoffLimitExceededIT extends BaseIT { | ||
|
|
||
| @RegisterExtension | ||
| static DataJobDeploymentExtension dataJobDeploymentExtension = new DataJobDeploymentExtension(); | ||
|
|
||
| @Test | ||
| public void testDataJob_causesBackoffLimitExceeded_shouldCompleteWithUserError( | ||
| String jobName, String teamName, String username, String deploymentId) throws Exception { | ||
| // manually start job execution | ||
| ImmutablePair<String, String> executeDataJobResult = | ||
| executeDataJob(jobName, teamName, username, deploymentId, mockMvc); | ||
| String opId = executeDataJobResult.getLeft(); | ||
| String executionId = executeDataJobResult.getRight(); | ||
|
|
||
| // Check the data job execution status | ||
| testDataJobExecutionRead( | ||
| executionId, | ||
| DataJobExecution.StatusEnum.USER_ERROR, | ||
| opId, | ||
| jobName, | ||
| teamName, | ||
| username, | ||
| mockMvc); | ||
| testDataJobExecutionList( | ||
| executionId, | ||
| DataJobExecution.StatusEnum.USER_ERROR, | ||
| opId, | ||
| jobName, | ||
| teamName, | ||
| username, | ||
| mockMvc); | ||
| testDataJobDeploymentExecutionList( | ||
| executionId, | ||
| DataJobExecution.StatusEnum.USER_ERROR, | ||
| opId, | ||
| jobName, | ||
| teamName, | ||
| username, | ||
| mockMvc); | ||
| } | ||
| } |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.