diff options
author | Pierre <pierre.guillot@sonarsource.com> | 2020-06-02 16:13:48 +0200 |
---|---|---|
committer | sonartech <sonartech@sonarsource.com> | 2020-06-26 20:04:56 +0000 |
commit | e4b519ed129dbc7b76eab00d6c48166a8993e35f (patch) | |
tree | 2f79b9a0bdeccd1494fcc1ac4d3a14cb78b50999 /server/sonar-ce-common | |
parent | ac3abae6429931aa5065b9f1ac359ff9a4ca78fd (diff) | |
download | sonarqube-e4b519ed129dbc7b76eab00d6c48166a8993e35f.tar.gz sonarqube-e4b519ed129dbc7b76eab00d6c48166a8993e35f.zip |
SONAR-13444 background tasks for issue indexation implementation
Diffstat (limited to 'server/sonar-ce-common')
-rw-r--r-- | server/sonar-ce-common/src/test/java/org/sonar/ce/queue/CeQueueImplTest.java | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/server/sonar-ce-common/src/test/java/org/sonar/ce/queue/CeQueueImplTest.java b/server/sonar-ce-common/src/test/java/org/sonar/ce/queue/CeQueueImplTest.java index f0f2a205930..1c155e145e6 100644 --- a/server/sonar-ce-common/src/test/java/org/sonar/ce/queue/CeQueueImplTest.java +++ b/server/sonar-ce-common/src/test/java/org/sonar/ce/queue/CeQueueImplTest.java @@ -35,7 +35,6 @@ import org.sonar.ce.task.CeTask; import org.sonar.core.util.SequenceUuidFactory; import org.sonar.core.util.UuidFactory; import org.sonar.core.util.UuidFactoryFast; -import org.sonar.core.util.UuidFactoryImpl; import org.sonar.db.DbSession; import org.sonar.db.DbTester; import org.sonar.db.ce.CeActivityDto; @@ -397,7 +396,7 @@ public class CeQueueImplTest { @Test public void fail_to_cancel_if_in_progress() { submit(CeTaskTypes.REPORT, newComponent(randomAlphabetic(11))); - CeQueueDto ceQueueDto = db.getDbClient().ceQueueDao().peek(session, WORKER_UUID).get(); + CeQueueDto ceQueueDto = db.getDbClient().ceQueueDao().peek(session, WORKER_UUID, false).get(); expectedException.expect(IllegalStateException.class); expectedException.expectMessage(startsWith("Task is in progress and can't be canceled")); @@ -411,7 +410,7 @@ public class CeQueueImplTest { CeTask pendingTask1 = submit(CeTaskTypes.REPORT, newComponent(randomAlphabetic(12))); CeTask pendingTask2 = submit(CeTaskTypes.REPORT, newComponent(randomAlphabetic(12))); - db.getDbClient().ceQueueDao().peek(session, WORKER_UUID); + db.getDbClient().ceQueueDao().peek(session, WORKER_UUID, false); int canceledCount = underTest.cancelAll(); assertThat(canceledCount).isEqualTo(2); @@ -438,7 +437,7 @@ public class CeQueueImplTest { @Test public void pauseWorkers_marks_workers_as_pausing_if_some_tasks_in_progress() { submit(CeTaskTypes.REPORT, newComponent(randomAlphabetic(12))); - db.getDbClient().ceQueueDao().peek(session, WORKER_UUID); + db.getDbClient().ceQueueDao().peek(session, WORKER_UUID, false); // task is in-progress assertThat(underTest.getWorkersPauseStatus()).isEqualTo(CeQueue.WorkersPauseStatus.RESUMED); @@ -459,7 +458,7 @@ public class CeQueueImplTest { @Test public void resumeWorkers_resumes_pausing_workers() { submit(CeTaskTypes.REPORT, newComponent(randomAlphabetic(12))); - db.getDbClient().ceQueueDao().peek(session, WORKER_UUID); + db.getDbClient().ceQueueDao().peek(session, WORKER_UUID, false); // task is in-progress underTest.pauseWorkers(); @@ -481,7 +480,7 @@ public class CeQueueImplTest { @Test public void fail_in_progress_task() { CeTask task = submit(CeTaskTypes.REPORT, newComponent(randomAlphabetic(12))); - CeQueueDto queueDto = db.getDbClient().ceQueueDao().peek(db.getSession(), WORKER_UUID).get(); + CeQueueDto queueDto = db.getDbClient().ceQueueDao().peek(db.getSession(), WORKER_UUID, false).get(); underTest.fail(db.getSession(), queueDto, "TIMEOUT", "Failed on timeout"); |