Skip to content

test(run): register context engine before each REST test (2.2.x) - #4063

Merged
kthoms merged 1 commit into
release/2.2.xfrom
fix/run-test-default-engine-registration-2.2
Nov 7, 2026
Merged

kthoms merged 1 commit into
release/2.2.xfrom
fix/run-test-default-engine-registration-2.2

Conversation

@kthoms

@kthoms kthoms commented Nov 7, 2026

Copy link
Copy Markdown
Contributor

CorsConfigurationEnabledWildcardTest failed in the integration build on release/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(). CorsAuthenticationTest uses its own Spring context (@DirtiesContext(AFTER_CLASS)) whose engine is also named default. Closing that context unregisters default, removing the registration the cached test-cors-enabled context 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: AbstractRestTest registers 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 and reversealphabetical order.

🤖 Generated with Claude Code

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)
@kthoms kthoms added this to the 2.2.1 milestone Nov 7, 2026
Copilot AI balanced review requested due to automatic review settings November 7, 2026 05:21

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota. Try requesting a review at a lower effort level.

@github-actions github-actions Bot added lang:java Pull requests that update Java code distro:operaton Issues & changes related to the Operaton standalone distribution scope:tests Changes affecting only test code labels Nov 7, 2026
@kthoms
kthoms merged commit 750993b into release/2.2.x Nov 7, 2026
5 checks passed
@kthoms
kthoms deleted the fix/run-test-default-engine-registration-2.2 branch November 7, 2026 05:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

distro:operaton Issues & changes related to the Operaton standalone distribution 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