Skip to content

Commit

Permalink
feat: Lock single job for a project
Browse files Browse the repository at this point in the history
  • Loading branch information
JanCizmar committed Jul 26, 2023
1 parent ed99238 commit 637ccbc
Showing 1 changed file with 12 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -232,17 +232,19 @@ class BatchJobManagementControllerTest : ProjectAuthControllerTest("/v2/projects
val adminsJobs = (1..3).map { runChunkedJob(50) }
val anotherUsersJobs = (1..3).map { runChunkedJob(50, testData.anotherUser) }

performProjectAuthGet("current-batch-jobs")
.andIsOk.andPrettyPrint.andAssertThatJson {
node("_embedded.batchJobs") {
isArray.hasSize(6)
node("[0].status").isEqualTo("RUNNING")
node("[1].status").isEqualTo("RUNNING")
node("[2].status").isEqualTo("PENDING")
try {
performProjectAuthGet("current-batch-jobs")
.andIsOk.andPrettyPrint.andAssertThatJson {
node("_embedded.batchJobs") {
isArray.hasSize(6)
node("[0].status").isEqualTo("RUNNING")
node("[1].status").isEqualTo("PENDING")
node("[2].status").isEqualTo("PENDING")
}
}
}

wait = false
} finally {
wait = false
}

waitForNotThrowing(pollTime = 1000, timeout = 10000) {
val dtos = (adminsJobs + anotherUsersJobs).map { batchJobService.getJobDto(it.id) }
Expand Down

0 comments on commit 637ccbc

Please sign in to comment.