Repository navigation
fix(engine): reinitialize stale engine in ProcessEngineExtension - #4070
Merged
Merged
Conversation
A static extension shared by several test classes kept a closed engine after ProcessEngines.destroy(). The next class registered a new engine under the same name, so the name check passed and tests used the closed engine. Its job executor acquired jobs for no engine, which made job executor tests time out depending on class order. Check the registered instance by identity in beforeEach and postProcessTestInstance. Fixes #4052
|
kthoms
pushed a commit
that referenced
this pull request
Nov 8, 2026
(cherry picked from commit 77aa11b)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.



Fixes #4052
Problem
Several abstract test bases hold a static
ProcessEngineExtensionthat all subclasses share(
AbstractUserOperationLogTest,AbstractDefinitionQueryTest,EmailTestCase,AbstractMetricsTest).Tests like
RuntimeServiceTest.testStartProcessInstanceByIdAfterRebootandstandalone.initialization.ProcessEnginesTestcallProcessEngines.destroy(), which closes the cached engine.The next test class registers a new engine named
default. The extension only checked the name, so it kept theclosed engine. That engine's job executor no longer has a registered engine and acquires nothing, so tests that
wait for the job executor time out (
UserOperationLogJobTest,ProcessDefinitionQueryTest,AsyncEmailTaskTest,TaskListenerTest,JobExecutorMetricsTest, ...). Whether this happens depends on class order, which is why thenightly turned red after the runner image changed.
Fix
beforeEachandpostProcessTestInstancenow compare the registered engine by identity. Both are needed:services are injected in
postProcessTestInstance, beforebeforeEachruns.Verification
Engine tests on H2 with
junit.jupiter.testclass.order.default=org.junit.jupiter.api.ClassOrderer$Random:Minimal repro for seed 63865769:
RedeploymentRegistrationTest,CaseDefinitionQueryTest,ProcessEnginesTest,ErrorEventSubProcessTest, thenProcessDefinitionQueryTestfails. Green with the fix.To reproduce: