From 8f1e4cd2e616c3e0c9f71861bc9d48881226363b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Joaqu=C3=ADn?= Date: Thu, 27 Jun 2024 14:31:57 +0200 Subject: [PATCH] chore(crdb): remove usages of isOptimisticLockingExceptionSuppressible --- .../mgmt/metrics/JobExecutorMetricsTest.java | 20 ++++-------- ...tingTransactionsOptimisticLockingTest.java | 4 +-- .../CompetingExternalTaskFetchingTest.java | 4 +-- .../CompetingJobAcquisitionTest.java | 10 +++--- .../concurrency/ConcurrentDeploymentTest.java | 8 ++--- ...ncurrentHistoryCleanupReconfigureTest.java | 4 +-- .../ConcurrentHistoryCleanupTest.java | 6 +--- .../ConcurrentHistoryLevelTest.java | 4 +-- ...rrentInstallationIdInitializationTest.java | 4 +-- .../ConcurrentJobExecutorTest.java | 16 ++++------ ...ngineJobExecutorHistoryCleanupJobTest.java | 8 ++--- .../ConcurrentTelemetryConfigurationTest.java | 6 ++-- ...ingHistoricAttachmentPartitioningTest.java | 4 +-- ...tingHistoricByteArrayPartitioningTest.java | 6 ++-- ...toricVariableInstancePartitioningTest.java | 6 ++-- .../JobAcquisitionBackoffTest.java | 32 ++++++++----------- .../test/jobexecutor/JobAcquisitionTest.java | 4 +-- .../test/util/ProcessEngineTestRule.java | 13 -------- 18 files changed, 50 insertions(+), 109 deletions(-) diff --git a/engine/src/test/java/org/camunda/bpm/engine/test/api/mgmt/metrics/JobExecutorMetricsTest.java b/engine/src/test/java/org/camunda/bpm/engine/test/api/mgmt/metrics/JobExecutorMetricsTest.java index 697cd376337..ab648ab3a0a 100644 --- a/engine/src/test/java/org/camunda/bpm/engine/test/api/mgmt/metrics/JobExecutorMetricsTest.java +++ b/engine/src/test/java/org/camunda/bpm/engine/test/api/mgmt/metrics/JobExecutorMetricsTest.java @@ -79,9 +79,7 @@ public void testJobAcquisitionMetricReporting() { long acquiredJobs = managementService.createMetricsQuery() .name(Metrics.JOB_ACQUIRED_SUCCESS).sum(); - if (testRule.isOptimisticLockingExceptionSuppressible()) { - assertEquals(3, acquiredJobs); - } + assertEquals(3, acquiredJobs); } @Deployment(resources = "org/camunda/bpm/engine/test/api/mgmt/metrics/asyncServiceTaskProcess.bpmn20.xml") @@ -128,9 +126,7 @@ public void testCompetingJobAcquisitionMetricReporting() { long acquiredJobsFailure = managementService.createMetricsQuery() .name(Metrics.JOB_ACQUIRED_FAILURE).sum(); - if (testRule.isOptimisticLockingExceptionSuppressible()) { - assertEquals(3, acquiredJobsFailure); - } + assertEquals(3, acquiredJobsFailure); // cleanup jobExecutor1.shutdown(); @@ -187,13 +183,11 @@ public void testJobExecutionMetricExclusiveFollowUp() { .name(Metrics.JOB_LOCKED_EXCLUSIVE).sum(); assertEquals(6, jobsSuccessful); - if (testRule.isOptimisticLockingExceptionSuppressible()) { - assertEquals(0, jobsFailed); - // the respective follow-up jobs are exclusive and have been executed right away without - // acquisition - assertEquals(3, jobCandidatesForAcquisition); - assertEquals(3, exclusiveFollowupJobs); - } + assertEquals(0, jobsFailed); + // the respective follow-up jobs are exclusive and have been executed right away without + // acquisition + assertEquals(3, jobCandidatesForAcquisition); + assertEquals(3, exclusiveFollowupJobs); } @Deployment(resources = "org/camunda/bpm/engine/test/api/mgmt/metrics/asyncServiceTaskProcess.bpmn20.xml") diff --git a/engine/src/test/java/org/camunda/bpm/engine/test/concurrency/AbstractCompetingTransactionsOptimisticLockingTest.java b/engine/src/test/java/org/camunda/bpm/engine/test/concurrency/AbstractCompetingTransactionsOptimisticLockingTest.java index fe3b7cbdbed..db470e5875e 100644 --- a/engine/src/test/java/org/camunda/bpm/engine/test/concurrency/AbstractCompetingTransactionsOptimisticLockingTest.java +++ b/engine/src/test/java/org/camunda/bpm/engine/test/concurrency/AbstractCompetingTransactionsOptimisticLockingTest.java @@ -84,9 +84,7 @@ public void shouldDetectConcurrentDeletionOfExecutionForTaskInsert() { // then assertThat(thread1.exception).isNotNull(); - if (getTestRule().isOptimisticLockingExceptionSuppressible()) { - assertThat(thread1.exception).isInstanceOf(OptimisticLockingException.class); - } + assertThat(thread1.exception).isInstanceOf(OptimisticLockingException.class); } @Deployment(resources = "org/camunda/bpm/engine/test/concurrency/AbstractCompetingTransactionsOptimisticLockingTest.shouldDetectConcurrentDeletionOfExecutionForTaskInsert.bpmn20.xml") diff --git a/engine/src/test/java/org/camunda/bpm/engine/test/concurrency/CompetingExternalTaskFetchingTest.java b/engine/src/test/java/org/camunda/bpm/engine/test/concurrency/CompetingExternalTaskFetchingTest.java index 8ce4fa177db..88dc74932f8 100644 --- a/engine/src/test/java/org/camunda/bpm/engine/test/concurrency/CompetingExternalTaskFetchingTest.java +++ b/engine/src/test/java/org/camunda/bpm/engine/test/concurrency/CompetingExternalTaskFetchingTest.java @@ -117,8 +117,6 @@ public void testCompetingExternalTaskFetching() { thread2.proceedAndWaitTillDone(); assertEquals(0, thread2.fetchedTasks.size()); // but does not fail with an OptimisticLockingException - if (testRule.isOptimisticLockingExceptionSuppressible()) { - assertNull(thread2.exception); - } + assertNull(thread2.exception); } } diff --git a/engine/src/test/java/org/camunda/bpm/engine/test/concurrency/CompetingJobAcquisitionTest.java b/engine/src/test/java/org/camunda/bpm/engine/test/concurrency/CompetingJobAcquisitionTest.java index c5c93762fca..b74445b4c4a 100644 --- a/engine/src/test/java/org/camunda/bpm/engine/test/concurrency/CompetingJobAcquisitionTest.java +++ b/engine/src/test/java/org/camunda/bpm/engine/test/concurrency/CompetingJobAcquisitionTest.java @@ -98,12 +98,10 @@ public void testCompetingJobAcquisitions() { LOG.debug("test thread notifies thread 2"); threadTwo.proceedAndWaitTillDone(); - if (testRule.isOptimisticLockingExceptionSuppressible()) { - // the acquisition did NOT fail - assertNull(threadTwo.exception); - // but the job was not acquired - assertEquals(0, threadTwo.jobs.size()); - } + // the acquisition did NOT fail + assertNull(threadTwo.exception); + // but the job was not acquired + assertEquals(0, threadTwo.jobs.size()); } public class JobAcquisitionThread extends ControllableThread { diff --git a/engine/src/test/java/org/camunda/bpm/engine/test/concurrency/ConcurrentDeploymentTest.java b/engine/src/test/java/org/camunda/bpm/engine/test/concurrency/ConcurrentDeploymentTest.java index 1813f4be90f..0ee35a58992 100644 --- a/engine/src/test/java/org/camunda/bpm/engine/test/concurrency/ConcurrentDeploymentTest.java +++ b/engine/src/test/java/org/camunda/bpm/engine/test/concurrency/ConcurrentDeploymentTest.java @@ -89,11 +89,9 @@ public void testVersioning() throws InterruptedException { .asc() .list(); - if (testRule.isOptimisticLockingExceptionSuppressible()) { - assertThat(processDefinitions.size()).isEqualTo(2); - assertThat(processDefinitions.get(0).getVersion()).isEqualTo(1); - assertThat(processDefinitions.get(1).getVersion()).isEqualTo(2); - } + assertThat(processDefinitions.size()).isEqualTo(2); + assertThat(processDefinitions.get(0).getVersion()).isEqualTo(1); + assertThat(processDefinitions.get(1).getVersion()).isEqualTo(2); } protected DeploymentBuilder createDeploymentBuilder() { diff --git a/engine/src/test/java/org/camunda/bpm/engine/test/concurrency/ConcurrentHistoryCleanupReconfigureTest.java b/engine/src/test/java/org/camunda/bpm/engine/test/concurrency/ConcurrentHistoryCleanupReconfigureTest.java index 864e33e8e6d..52ac37c3ab7 100644 --- a/engine/src/test/java/org/camunda/bpm/engine/test/concurrency/ConcurrentHistoryCleanupReconfigureTest.java +++ b/engine/src/test/java/org/camunda/bpm/engine/test/concurrency/ConcurrentHistoryCleanupReconfigureTest.java @@ -97,9 +97,7 @@ public void testReconfigureCleanupJobs() { // there were no failures for the first job reconfiguration assertThat(engineOne.getException()).isNull(); - if (testRule.isOptimisticLockingExceptionSuppressible()) { - assertThat(engineTwo.getException()).isNull(); - } + assertThat(engineTwo.getException()).isNull(); } public class EngineOne extends ControllableCommand { diff --git a/engine/src/test/java/org/camunda/bpm/engine/test/concurrency/ConcurrentHistoryCleanupTest.java b/engine/src/test/java/org/camunda/bpm/engine/test/concurrency/ConcurrentHistoryCleanupTest.java index 0d314e205ad..0e2726874ba 100644 --- a/engine/src/test/java/org/camunda/bpm/engine/test/concurrency/ConcurrentHistoryCleanupTest.java +++ b/engine/src/test/java/org/camunda/bpm/engine/test/concurrency/ConcurrentHistoryCleanupTest.java @@ -94,11 +94,7 @@ public void testRunTwoHistoryCleanups() throws InterruptedException { assertEquals(1, historyCleanupJobs.size()); assertNull(thread1.getException()); - if (testRule.isOptimisticLockingExceptionSuppressible()) { - assertNull(thread2.getException()); - } else { - assertThat(thread2.getException()).isInstanceOf(OptimisticLockingException.class); - } + assertNull(thread2.getException()); } diff --git a/engine/src/test/java/org/camunda/bpm/engine/test/concurrency/ConcurrentHistoryLevelTest.java b/engine/src/test/java/org/camunda/bpm/engine/test/concurrency/ConcurrentHistoryLevelTest.java index c2ba4d4de3b..c82573fc776 100644 --- a/engine/src/test/java/org/camunda/bpm/engine/test/concurrency/ConcurrentHistoryLevelTest.java +++ b/engine/src/test/java/org/camunda/bpm/engine/test/concurrency/ConcurrentHistoryLevelTest.java @@ -73,9 +73,7 @@ public void test() throws InterruptedException { assertNull(thread1.getException()); Throwable thread2Exception = thread2.getException(); - if (testRule.isOptimisticLockingExceptionSuppressible()) { - assertNull(thread2Exception); - } + assertNull(thread2Exception); HistoryLevel historyLevel = processEngineConfiguration.getHistoryLevel(); assertEquals("full", historyLevel.getName()); } diff --git a/engine/src/test/java/org/camunda/bpm/engine/test/concurrency/ConcurrentInstallationIdInitializationTest.java b/engine/src/test/java/org/camunda/bpm/engine/test/concurrency/ConcurrentInstallationIdInitializationTest.java index 97fa2c9f700..1642ff896e1 100644 --- a/engine/src/test/java/org/camunda/bpm/engine/test/concurrency/ConcurrentInstallationIdInitializationTest.java +++ b/engine/src/test/java/org/camunda/bpm/engine/test/concurrency/ConcurrentInstallationIdInitializationTest.java @@ -73,9 +73,7 @@ public void test() throws InterruptedException { assertNull(thread1.getException()); Throwable thread2Exception = thread2.getException(); - if (testRule.isOptimisticLockingExceptionSuppressible()) { - assertNull(thread2Exception); - } + assertNull(thread2Exception); String id = processEngineConfiguration.getInstallationId(); assertThat(id).isNotEmpty(); diff --git a/engine/src/test/java/org/camunda/bpm/engine/test/concurrency/ConcurrentJobExecutorTest.java b/engine/src/test/java/org/camunda/bpm/engine/test/concurrency/ConcurrentJobExecutorTest.java index 4c32c8c6b04..a8747f0e589 100644 --- a/engine/src/test/java/org/camunda/bpm/engine/test/concurrency/ConcurrentJobExecutorTest.java +++ b/engine/src/test/java/org/camunda/bpm/engine/test/concurrency/ConcurrentJobExecutorTest.java @@ -323,11 +323,9 @@ public void testCompletingSuspendJobDuringAcquisition() { // then the acquisition will not fail with optimistic locking assertNull(jobSuspensionThread.exception); - if (testRule.isOptimisticLockingExceptionSuppressible()) { - assertNull(acquisitionThread.exception); - // but the job will also not be acquired - assertEquals(0, acquisitionThread.acquiredJobs.size()); - } + assertNull(acquisitionThread.exception); + // but the job will also not be acquired + assertEquals(0, acquisitionThread.acquiredJobs.size()); //-------------------------------------------- @@ -418,12 +416,10 @@ public void testCompletingUpdateJobDefinitionPriorityDuringExecution() { executionThread.proceedAndWaitTillDone(); long remainingJobCount = managementService.createJobQuery().count(); - if (testRule.isOptimisticLockingExceptionSuppressible()) { - assertNull(executionThread.exception); + assertNull(executionThread.exception); - // and ultimately only one job with an updated priority is left - assertEquals(1L, remainingJobCount); - } + // and ultimately only one job with an updated priority is left + assertEquals(1L, remainingJobCount); } @Test diff --git a/engine/src/test/java/org/camunda/bpm/engine/test/concurrency/ConcurrentProcessEngineJobExecutorHistoryCleanupJobTest.java b/engine/src/test/java/org/camunda/bpm/engine/test/concurrency/ConcurrentProcessEngineJobExecutorHistoryCleanupJobTest.java index d7521b7d027..9ec7861c0eb 100644 --- a/engine/src/test/java/org/camunda/bpm/engine/test/concurrency/ConcurrentProcessEngineJobExecutorHistoryCleanupJobTest.java +++ b/engine/src/test/java/org/camunda/bpm/engine/test/concurrency/ConcurrentProcessEngineJobExecutorHistoryCleanupJobTest.java @@ -149,11 +149,9 @@ public void testConcurrentHistoryCleanupJobReconfigurationExecution() throws Int assertNull(thread1.getException()); - if (testRule.isOptimisticLockingExceptionSuppressible()) { - assertNull(thread2.getException()); - assertNull(bootstrapCommand.getContextSpy().getThrowable()); - assertNotNull(ProcessEngines.getProcessEngines().get(PROCESS_ENGINE_NAME)); - } + assertNull(thread2.getException()); + assertNull(bootstrapCommand.getContextSpy().getThrowable()); + assertNotNull(ProcessEngines.getProcessEngines().get(PROCESS_ENGINE_NAME)); } protected static class ControllableProcessEngineBootstrapCommand extends ControllableCommand { diff --git a/engine/src/test/java/org/camunda/bpm/engine/test/concurrency/ConcurrentTelemetryConfigurationTest.java b/engine/src/test/java/org/camunda/bpm/engine/test/concurrency/ConcurrentTelemetryConfigurationTest.java index 3a0132437df..da5c9ca030b 100644 --- a/engine/src/test/java/org/camunda/bpm/engine/test/concurrency/ConcurrentTelemetryConfigurationTest.java +++ b/engine/src/test/java/org/camunda/bpm/engine/test/concurrency/ConcurrentTelemetryConfigurationTest.java @@ -73,10 +73,8 @@ public void testEnableTelemetryWithoutConcurrencyIssue() throws InterruptedExcep thread2.waitUntilDone(); assertNull(thread1.getException()); - if (testRule.isOptimisticLockingExceptionSuppressible()) { - assertNull(thread2.getException()); - assertThat(managementService.isTelemetryEnabled()).isFalse(); - } + assertNull(thread2.getException()); + assertThat(managementService.isTelemetryEnabled()).isFalse(); } protected static class ControllableUpdateTelemetrySetupCommand extends ControllableCommand { diff --git a/engine/src/test/java/org/camunda/bpm/engine/test/concurrency/partitioning/CompetingHistoricAttachmentPartitioningTest.java b/engine/src/test/java/org/camunda/bpm/engine/test/concurrency/partitioning/CompetingHistoricAttachmentPartitioningTest.java index a31fcd03a3a..b90dbd41bce 100644 --- a/engine/src/test/java/org/camunda/bpm/engine/test/concurrency/partitioning/CompetingHistoricAttachmentPartitioningTest.java +++ b/engine/src/test/java/org/camunda/bpm/engine/test/concurrency/partitioning/CompetingHistoricAttachmentPartitioningTest.java @@ -56,9 +56,7 @@ public void shouldSuppressOleOnConcurrentFetchAndDelete() { asyncThread.waitUntilDone(); // then - if (testRule.isOptimisticLockingExceptionSuppressible()) { - assertThat(taskService.getAttachment(attachment.getId())).isNull(); - } + assertThat(taskService.getAttachment(attachment.getId())).isNull(); } public class AsyncThread extends ControllableCommand { diff --git a/engine/src/test/java/org/camunda/bpm/engine/test/concurrency/partitioning/CompetingHistoricByteArrayPartitioningTest.java b/engine/src/test/java/org/camunda/bpm/engine/test/concurrency/partitioning/CompetingHistoricByteArrayPartitioningTest.java index 8f2c364672d..14310e553e4 100644 --- a/engine/src/test/java/org/camunda/bpm/engine/test/concurrency/partitioning/CompetingHistoricByteArrayPartitioningTest.java +++ b/engine/src/test/java/org/camunda/bpm/engine/test/concurrency/partitioning/CompetingHistoricByteArrayPartitioningTest.java @@ -84,10 +84,8 @@ public void shouldSuppressOleOnConcurrentFetchAndDelete() { asyncThread.waitUntilDone(); // then - if (testRule.isOptimisticLockingExceptionSuppressible()) { - assertThat(runtimeService.createVariableInstanceQuery().singleResult().getName()).isEqualTo(VARIABLE_NAME); - assertThat(new String((byte[]) runtimeService.createVariableInstanceQuery().singleResult().getValue())).isEqualTo(ANOTHER_VARIABLE_VALUE); - } + assertThat(runtimeService.createVariableInstanceQuery().singleResult().getName()).isEqualTo(VARIABLE_NAME); + assertThat(new String((byte[]) runtimeService.createVariableInstanceQuery().singleResult().getValue())).isEqualTo(ANOTHER_VARIABLE_VALUE); } public class AsyncThread extends ControllableCommand { diff --git a/engine/src/test/java/org/camunda/bpm/engine/test/concurrency/partitioning/CompetingHistoricVariableInstancePartitioningTest.java b/engine/src/test/java/org/camunda/bpm/engine/test/concurrency/partitioning/CompetingHistoricVariableInstancePartitioningTest.java index 2145ccf33b0..4aa5986682f 100644 --- a/engine/src/test/java/org/camunda/bpm/engine/test/concurrency/partitioning/CompetingHistoricVariableInstancePartitioningTest.java +++ b/engine/src/test/java/org/camunda/bpm/engine/test/concurrency/partitioning/CompetingHistoricVariableInstancePartitioningTest.java @@ -61,10 +61,8 @@ public void shouldSuppressOleOnConcurrentFetchAndDelete() { asyncThread.waitUntilDone(); // then - if (testRule.isOptimisticLockingExceptionSuppressible()) { - assertThat(runtimeService.createVariableInstanceQuery().singleResult().getName()).isEqualTo(VARIABLE_NAME); - assertThat(runtimeService.createVariableInstanceQuery().singleResult().getValue()).isEqualTo(ANOTHER_VARIABLE_VALUE); - } + assertThat(runtimeService.createVariableInstanceQuery().singleResult().getName()).isEqualTo(VARIABLE_NAME); + assertThat(runtimeService.createVariableInstanceQuery().singleResult().getValue()).isEqualTo(ANOTHER_VARIABLE_VALUE); } public class AsyncThread extends ControllableCommand { diff --git a/engine/src/test/java/org/camunda/bpm/engine/test/jobexecutor/JobAcquisitionBackoffTest.java b/engine/src/test/java/org/camunda/bpm/engine/test/jobexecutor/JobAcquisitionBackoffTest.java index 6577d81a0dd..bd5417e31d9 100644 --- a/engine/src/test/java/org/camunda/bpm/engine/test/jobexecutor/JobAcquisitionBackoffTest.java +++ b/engine/src/test/java/org/camunda/bpm/engine/test/jobexecutor/JobAcquisitionBackoffTest.java @@ -125,11 +125,9 @@ public void testBackoffOnOptimisticLocking() { Assert.assertEquals(1, jobExecutor2WaitEvents.size()); RecordedWaitEvent waitEvent = jobExecutor2WaitEvents.get(0); - if (testRule.isOptimisticLockingExceptionSuppressible()) { - // we don't know the exact wait time, - // since there is random jitter applied - JobAcquisitionTestHelper.assertInBetween(BASE_BACKOFF_TIME, BASE_BACKOFF_TIME + BASE_BACKOFF_TIME / 2, waitEvent.getTimeBetweenAcquisitions()); - } + // we don't know the exact wait time, + // since there is random jitter applied + JobAcquisitionTestHelper.assertInBetween(BASE_BACKOFF_TIME, BASE_BACKOFF_TIME + BASE_BACKOFF_TIME / 2, waitEvent.getTimeBetweenAcquisitions()); // when performing another cycle of acquisition JobAcquisitionTestHelper.activateInstances(engineRule.getProcessEngine(), 6); @@ -158,13 +156,11 @@ public void testBackoffOnOptimisticLocking() { RecordedWaitEvent secondWaitEvent = jobExecutor2WaitEvents.get(1); long expectedBackoffTime = BASE_BACKOFF_TIME * BACKOFF_FACTOR; // 1000 * 2^1 - if (testRule.isOptimisticLockingExceptionSuppressible()) { - // then thread 2 has tried to acquire 6 jobs this time - Assert.assertEquals(6, secondAcquisitionAttempt.getNumJobsToAcquire()); - // and again increased its backoff - Assert.assertEquals(2, jobExecutor2WaitEvents.size()); - JobAcquisitionTestHelper.assertInBetween(expectedBackoffTime, expectedBackoffTime + expectedBackoffTime / 2, secondWaitEvent.getTimeBetweenAcquisitions()); - } + // then thread 2 has tried to acquire 6 jobs this time + Assert.assertEquals(6, secondAcquisitionAttempt.getNumJobsToAcquire()); + // and again increased its backoff + Assert.assertEquals(2, jobExecutor2WaitEvents.size()); + JobAcquisitionTestHelper.assertInBetween(expectedBackoffTime, expectedBackoffTime + expectedBackoffTime / 2, secondWaitEvent.getTimeBetweenAcquisitions()); } @Test @@ -208,14 +204,12 @@ public void testBackoffDecrease() { acquisitionThread2.makeContinueAndWaitForSync(); // acquire acquisitionThread2.makeContinueAndWaitForSync(); // continue after acquisition with next cycle - if (testRule.isOptimisticLockingExceptionSuppressible()) { - for (int i = 1; i < BACKOFF_DECREASE_THRESHOLD; i++) { - // backoff has not decreased yet - Assert.assertTrue(jobExecutor2WaitEvents.get(i).getTimeBetweenAcquisitions() > 0); + for (int i = 1; i < BACKOFF_DECREASE_THRESHOLD; i++) { + // backoff has not decreased yet + Assert.assertTrue(jobExecutor2WaitEvents.get(i).getTimeBetweenAcquisitions() > 0); - acquisitionThread2.makeContinueAndWaitForSync(); // acquire - acquisitionThread2.makeContinueAndWaitForSync(); // continue after acquisition with next cycle - } + acquisitionThread2.makeContinueAndWaitForSync(); // acquire + acquisitionThread2.makeContinueAndWaitForSync(); // continue after acquisition with next cycle } // it decreases its backoff again diff --git a/engine/src/test/java/org/camunda/bpm/engine/test/jobexecutor/JobAcquisitionTest.java b/engine/src/test/java/org/camunda/bpm/engine/test/jobexecutor/JobAcquisitionTest.java index 0fabb1e0675..b741422cf82 100644 --- a/engine/src/test/java/org/camunda/bpm/engine/test/jobexecutor/JobAcquisitionTest.java +++ b/engine/src/test/java/org/camunda/bpm/engine/test/jobexecutor/JobAcquisitionTest.java @@ -116,8 +116,6 @@ public void testJobLockingFailure() { List jobExecutor2WaitEvents = jobExecutor2.getAcquireJobsRunnable().getWaitEvents(); Assert.assertEquals(1, jobExecutor2WaitEvents.size()); - if (testRule.isOptimisticLockingExceptionSuppressible()) { - Assert.assertEquals(0, jobExecutor2WaitEvents.get(0).getTimeBetweenAcquisitions()); - } + Assert.assertEquals(0, jobExecutor2WaitEvents.get(0).getTimeBetweenAcquisitions()); } } diff --git a/engine/src/test/java/org/camunda/bpm/engine/test/util/ProcessEngineTestRule.java b/engine/src/test/java/org/camunda/bpm/engine/test/util/ProcessEngineTestRule.java index 5f8d1ac2b9a..cc2335d653c 100644 --- a/engine/src/test/java/org/camunda/bpm/engine/test/util/ProcessEngineTestRule.java +++ b/engine/src/test/java/org/camunda/bpm/engine/test/util/ProcessEngineTestRule.java @@ -36,7 +36,6 @@ import org.camunda.bpm.engine.delegate.Expression; import org.camunda.bpm.engine.impl.cfg.ProcessEngineConfigurationImpl; import org.camunda.bpm.engine.impl.cmmn.behavior.CaseControlRuleImpl; -import org.camunda.bpm.engine.impl.db.sql.DbSqlSessionFactory; import org.camunda.bpm.engine.impl.el.FixedValue; import org.camunda.bpm.engine.impl.history.HistoryLevel; import org.camunda.bpm.engine.impl.interceptor.Command; @@ -417,18 +416,6 @@ public String getDatabaseType() { .getDatabaseType(); } - /** - * This methods is used to determine if the currently used database - * allows for OptimisticLockingExceptions to be ignored, or handled, - * without a transaction rollback and retry. Otherwise, it is false. - * - * Currently, the method only returns false when CockroachDB is used - * since this database implements its own OLE mechanism. - */ - public boolean isOptimisticLockingExceptionSuppressible() { // TODO: remove this usages - return !DbSqlSessionFactory.CRDB.equals(getDatabaseType()); - } - public void deleteAllAuthorizations() { AuthorizationService authorizationService = processEngine.getAuthorizationService();