Skip to content

Commit

Permalink
chore(engine): stabilize JobExecutorMetricsTest on CRDB
Browse files Browse the repository at this point in the history
* accounts for the case that more job errors can occur on CRDB
  but doesn't enforce it since this doesn't always happen

related to CAM-13728, closes camunda#1947
  • Loading branch information
tmetzke authored Jul 5, 2022
1 parent d379edb commit ae4fddc
Showing 1 changed file with 8 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -223,11 +223,14 @@ public void testJobExecutionMetricExclusiveFollowUp() {
assertEquals(3, jobCandidatesForAcquisition);
assertEquals(3, exclusiveFollowupJobs);
} else {
// on CRDB there are additional job failures due to a self-referencing foreign
// on CRDB there can be additional job failures due to a self-referencing foreign
// key constraint on the ACT_RU_EXECUTION table which causes a TransactionRetryError
assertTrue(jobsFailed > 0);
// this leads to more job retries and acquisitions
assertTrue(jobCandidatesForAcquisition >= 3);
if (jobsFailed > 0) {
// this leads to more job retries and acquisitions
assertTrue(jobCandidatesForAcquisition >= 3);
} else {
assertEquals(3, jobCandidatesForAcquisition);
}
assertEquals(3, exclusiveFollowupJobs);
}
}
Expand Down Expand Up @@ -257,7 +260,7 @@ public void testJobRejectedExecutionMetricReporting() {
public static class RejectingJobExecutor extends DefaultJobExecutor {

public RejectingJobExecutor() {
BlockingQueue<Runnable> threadPoolQueue = new ArrayBlockingQueue<Runnable>(queueSize);
BlockingQueue<Runnable> threadPoolQueue = new ArrayBlockingQueue<>(queueSize);
threadPoolExecutor = new ThreadPoolExecutor(corePoolSize, maxPoolSize, 0L, TimeUnit.MILLISECONDS, threadPoolQueue) {

@Override
Expand Down

0 comments on commit ae4fddc

Please sign in to comment.