Skip to content

fix(engine): Stabilize rejected job metrics test - #3097

Merged
kthoms merged 1 commit into
mainfrom
backport/camunda-5048-job-executor-metrics-flake
Jun 11, 2026
Merged

kthoms merged 1 commit into
mainfrom
backport/camunda-5048-job-executor-metrics-flake

Conversation

@hauptmedia

Copy link
Copy Markdown
Collaborator

Summary

Backports the Camunda 7 test stabilization from camunda/camunda-bpm-platform#5048. This is a test-only change for JobExecutorMetricsTest and does not change production behavior.

Why this is needed

Operaton main still uses waitForJobExecutorToProcessAllJobs(5000L) in testJobRejectedExecutionMetricReporting. That helper waits broadly for the job executor to process jobs instead of explicitly executing only the jobs created by this test case.

In larger or parallel test runs, that makes the test more sensitive to unrelated executable jobs in the same engine context and weakens the intent of the assertion: the metric should count the three jobs that were deliberately submitted to the rejecting executor.

Fix

The test now queries the job IDs for the deployed asyncServiceTaskProcess instances and executes exactly those jobs through the currently configured RejectingJobExecutor. The final metric assertion remains the same: JOB_EXECUTION_REJECTED must be 3.

I adapted the original patch to the current Operaton/JUnit 5 test style and reused the existing processEngineConfiguration field instead of adding an extra configuration cast.

Attribution

Original Camunda change:

Verification

  • ./mvnw -pl engine -Dtest=JobExecutorMetricsTest#testJobRejectedExecutionMetricReporting test
  • ./mvnw -pl engine -Dtest=JobExecutorMetricsTest test

Related to https://github.com/camunda/team-automation-platform/issues/304

Related to camunda/camunda-bpm-platform#5048

Backported commit 3998bf59f1f61647f5515c17d96ad0ea66a35ec5 from the camunda-bpm-platform repository.

Original author: Miklas Boskamp <[email protected]>

Backport change unit: 4789
@github-actions github-actions Bot added lang:java Pull requests that update Java code scope:tests Changes affecting only test code labels Jun 9, 2026
@hauptmedia hauptmedia added the backport:c7 Changes backported from Camunda 7 label Jun 9, 2026
@sonarqubecloud

sonarqubecloud Bot commented Jun 9, 2026

Copy link
Copy Markdown

@kthoms kthoms added this to the 2.2.0 milestone Jun 11, 2026
@kthoms
kthoms merged commit f05583e into main Jun 11, 2026
21 checks passed
@kthoms
kthoms deleted the backport/camunda-5048-job-executor-metrics-flake branch June 11, 2026 15:28
kthoms pushed a commit that referenced this pull request Jun 11, 2026
Related to https://github.com/camunda/team-automation-platform/issues/304

Related to camunda/camunda-bpm-platform#5048

Backported commit 3998bf59f1f61647f5515c17d96ad0ea66a35ec5 from the camunda-bpm-platform repository.

Original author: Miklas Boskamp <[email protected]>

Backport change unit: 4789

(cherry picked from commit f05583e)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backport:c7 Changes backported from Camunda 7 lang:java Pull requests that update Java code scope:tests Changes affecting only test code

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants