Fix Cucumber test retries running under Suite#11850
Conversation
Test Environment - sbt-scalatestJob Status: 🟢 success
Baseline: median of |
Test Environment - netflix-zuulJob Status: 🟢 success
Baseline: median of |
Test Environment - nebula-release-pluginJob Status: 🟢 success
Baseline: median of |
Test Environment - pass4sJob Status: 🟢 success
Baseline: median of |
Test Environment - reactive-streams-jvmJob Status: 🟢 success
Baseline: median of |
Test Environment - jolokiaJob Status: 🟢 success
Baseline: median of |
Test Environment - sonar-kotlinJob Status: 🟢 success
Baseline: median of |
Test Environment - okhttpJob Status: 🟢 success
Baseline: median of |
Test Environment - spring_bootJob Status: 🟢 success
Baseline: median of |
Test Environment - sonar-javaJob Status: 🟢 success
Baseline: median of |
There was a problem hiding this comment.
More details
The fix correctly uses JUnitPlatformUtils.getEngineId() — which walks the UniqueId segment list backward to return the innermost engine-type segment — instead of UniqueId.getEngineId(), which returns the root segment. Validated against 11 UniqueId shapes including all production patterns (plain Cucumber, Suite+Cucumber, Suite+Jupiter, Suite+Spock, no-engine, container variants); every case dispatches to the correct factory. No regressions found.
📊 Validated against 11 scenarios · Open Bits AI session
🤖 Datadog Autotest · Commit 70060ee · What is Autotest? · Any feedback? Reach out in #autotest
What Does This Do
TestDataFactoryby the leaf engine instead of the root one. Under@Suite, the unique id is rooted at the suite engine ([engine:junit-platform-suite]/[suite:…]/[engine:cucumber]/…). The previous approach, usingUniqueId.getEngineId()returns the root engine, which in these cases would point to JUnit instead of Cucumber.Motivation
Test execution policies (ATR, EFD, TIA, etc.) were silently not applied to Cucumber scenarios run via the JUnit Platform Suite Engine (
@Suite+junit-platform-suite-engine).The bug was masked because the instrumentation tests launch Cucumber directly via the Launcher API, with Cucumber as the root engine.
Additional Notes
Contributor Checklist
type:and (comp:orinst:) labels in addition to any other useful labelsclose,fix, or any linking keywords when referencing an issueUse
solvesinstead, and assign the PR milestone to the issue/merge. You can also:/merge --commit-message "..."/merge -c/merge -f --reason "reason"; please use this judiciously, as some checks do not run at the PR-level (note: the PR still needs to be mergeable, this will only skip the pre-merge build)Jira ticket: