Repository navigation
test(run): register context engine before each REST test (2.2.x) - #4063
Merged
kthoms merged 1 commit intoNov 7, 2026
Merged
Conversation
The REST API of Operaton Run resolves the process engine by name from the static ProcessEngines registry. When a test class with its own Spring context (e.g. CorsAuthenticationTest, which is @DirtiesContext) closes, its engine "default" is unregistered, which also removes the registration the cached contexts of other test classes rely on. A following test on a cached context then fails with 400 "No process engine available". AbstractRestTest now registers the engine of its context before each test, so the outcome no longer depends on the test execution order. Co-Authored-By: Claude Opus 5.5 <[email protected]> (cherry picked from commit 788d32a)
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.
CorsConfigurationEnabledWildcardTestfailed in the integration build onrelease/2.2.x(run 42310389773, Build (25)) with{"type":"InvalidRequestException","message":"No process engine available"}(HTTP 400).Root cause: the Run REST API looks up the engine via
ProcessEngines.getDefaultProcessEngine().CorsAuthenticationTestuses its own Spring context (@DirtiesContext(AFTER_CLASS)) whose engine is also nameddefault. Closing that context unregistersdefault, removing the registration the cachedtest-cors-enabledcontext relies on. Only test classes running after it on a cached context are affected, so the failure depends on the test execution order.Reproduced locally with
-Dsurefire.runOrder=alphabetical -Dtest='CorsAccessControlHeadersTest,CorsAuthenticationTest,CorsConfigurationEnabledWildcardTest'.Backport to
release/2.2.x.Fix:
AbstractRestTestregisters the engine of its own context before each test. Test-only change.Verified (
distro/run/core): reproduction order passes; all 42 tests pass in default andreversealphabeticalorder.🤖 Generated with Claude Code