Skip to content

test: make org.jbpm.executor.impl.jms.JmsAvaiableJobExecutorTest deterministic#2480

Open
Jack-LuoHongyi wants to merge 1 commit into
kiegroup:mainfrom
Jack-LuoHongyi:test/deterministic-jmsavaiablejobexecutortest
Open

test: make org.jbpm.executor.impl.jms.JmsAvaiableJobExecutorTest deterministic#2480
Jack-LuoHongyi wants to merge 1 commit into
kiegroup:mainfrom
Jack-LuoHongyi:test/deterministic-jmsavaiablejobexecutortest

Conversation

@Jack-LuoHongyi

Copy link
Copy Markdown

Summary

  • Type: concurrency-safe collection (listener recording)
  • Scope: test-only; no production changes
  • Module: jbpm-services/jbpm-executor
  • Test: org.jbpm.executor.impl.jms.JmsAvaiableJobExecutorTest#testAsyncAuditProducerPrioritizedJobs

Root Cause
The test records executed job keys from asynchronous callbacks into a shared list. The original list was not thread-safe, while callbacks may run on different threads, which can lead to occasional missed entries during concurrent writes.

Fix
Replace the list used to record executed job keys with a thread-safe collection (CopyOnWriteArrayList). This preserves the original assertions and intent — verifying that both "high priority" and "low priority" jobs are executed — without relaxing the checks.

Validation

  • Local execution passes consistently.
  • Additional stability validation performed using the Maven plugin edu.illinois:nondex-maven-plugin:2.1.7 with multiple runs.
  • Scope remains test-only; no production code is touched.

Risk
Low. The change is limited to test code and uses a standard JDK concurrency-safe collection. Assertions remain unchanged and continue to validate the same behavior.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant