Skip to content

9.0: Resolve Grails formats through Spring MVC's content negotiation - #16996

Merged
codeconsole merged 27 commits into
apache:9.0.xfrom
codeconsole:feat/spring-format-negotiation-9.0.x
Nov 20, 2026
Merged

codeconsole merged 27 commits into
apache:9.0.xfrom
codeconsole:feat/spring-format-negotiation-9.0.x

Conversation

@codeconsole

@codeconsole codeconsole commented Nov 14, 2026 •

Copy link
Copy Markdown
Contributor

Fixes #16698

Summary

Grails resolves request.format, response.format, withFormat and the format respond writes in with its own grails.mime rules, while Spring MVC's ContentNegotiationManager decides the type of what Spring MVC writes for an action: a ResponseEntity or ProblemDetail an action returns, a problem respond writes, and the JSON respond writes with Spring MVC. The two can answer the same request differently.

The opt-in grails.mime.negotiation.spring resolves the Grails formats with Spring MVC's manager too, as the formats grails.mime.types gives the media types it resolves. Grails 9 keeps its own rules by default; the plan is for Grails 10 to make the setting the default, as for the other migration settings in grails.config.Settings.

grails:
    mime:
        negotiation:
            spring: true

What becomes of each Grails rule

Grails rule With grails.mime.negotiation.spring
The format parameter and URL extensions select the format Kept, ahead of Spring MVC's strategies, and also for what Spring MVC writes for the request. A format grails.mime.types does not list is the type spring.mvc.contentnegotiation.media-types maps it to for what Spring MVC writes, while respond answers it with 406; a format neither maps is not acceptable. all, any type whether or not it is configured, leaves the format to the Accept header.
grails.mime.use.accept.header and grails.mime.disable.accept.header.* ignore the Accept header Kept, also for what Spring MVC writes for the request.
text/xml and application/xml are merged into one xml type Dropped: both are the xml format, in Spring MVC's order.
A +xml type comes ahead of application/xml of equal quality Kept, also for what Spring MVC writes for the request. Otherwise the types come in Spring MVC's order (quality, then specificity, then the header's order).
The problem types of RFC 9457 are the json and xml formats Extended to any +json/+xml type no configured type names, as Spring MVC's converters write them.
A request that accepts no configured type is answered as one that accepts any Dropped: it is not acceptable, as is one whose Accept header Spring cannot read.

A request that accepts no configured type has no format: response.format and response.mimeType are null, respond answers 406 Not Acceptable, and withFormat runs its * block, or none. Code that reads them allows for null, as the plugins in this repository do.

The kept rules are strategies installed into Spring MVC's manager (mvcContentNegotiationManager), which apply only while a URL mapping handles the request. With the setting, the URL mappings set the mapping as the request's HandlerMapping.BEST_MATCHING_HANDLER_ATTRIBUTE, as Spring MVC's own handler mappings set theirs, and take it off when the dispatch completes, or when a forward the action makes is to a handler no mapping matches; a web unit test sets it for the action it calls. Spring MVC endpoints, and Spring Security outside a Grails dispatch, negotiate as before, and GrailsContentNegotiationStrategy is still no ContentNegotiationStrategy bean.

Usage

An action whose ResponseEntity follows its URL extension, as its views do:

class BookController {

    def show(Long id) {
        ResponseEntity.ok(Book.get(id))   // /book/show/1.json is JSON whatever Accept says
    }
}

withFormat and respond now answer in Spring MVC's order, and a wildcard such as text/* with the first block or format compatible with it:

// Accept: */*, application/json  ->  json (the Grails rules give all, so the first block)
// Accept: text/*                  ->  html (the Grails rules run the first block, pdf)
withFormat {
    pdf { renderPdf(report) }
    html { [report: report] }
    json { respond report }
}

A format mapped only in Spring MVC still decides what Spring MVC writes for an action:

spring:
    mvc:
        contentnegotiation:
            media-types:
                plain: text/plain   # /book/note.plain and ?format=plain are written as text/plain

A body sent as application/merge-patch+json is of the json format, so data binding reads it as JSON.

Evidence

FormatNegotiationComparisonSpec runs a matrix of requests (Accept with qualities, wildcards and +json/+xml types, browser and XHR user agents, ?format=, Content-Type) through both policies under five configurations and records every answer that differs; the upgrade guide's new section 31 summarizes it.

Behaviour without the setting

Every negotiation answer is that of Grails 9, and the URL mappings' handler chain and request attributes are those of 9.0.x. Other changes that apply regardless:

  • A request whose response type resolves to none no longer fails the version lookup of URL mappings, nor the Spring Security plugin's URL matching, which threw a NullPointerException for it.
  • The strategy that resolves a request's formats is looked up once per request, and kept as a request attribute.
  • MimeTypesConfiguration.grailsMimeTypesWebMvcConfigurer, a static @Bean method of an internal package, takes the content negotiation manager as a third parameter.

…ndler

UrlMappingsHandlerMapping now sets HandlerMapping.BEST_MATCHING_HANDLER_ATTRIBUTE
to the UrlMappingInfo it returns, as Spring MVC's own handler mappings set it for
the handler they find, and takes it off the request once the dispatch completes,
with an interceptor first in the chain so that it completes last, whichever
interceptor stops the request. A dispatch another handler mapping handles in the
meantime, such as a forward to a Spring MVC endpoint, keeps the attribute it set.

Content negotiation can then tell a request a URL mapping handles from one a
Spring MVC endpoint handles, and from what Spring Security negotiates after the
dispatch. The version lookup no longer fails for a request whose response type
resolves to none.
…he#16698)

The opt-in grails.mime.negotiation.spring (default false in Grails 10) resolves
request.format, response.format, withFormat and the format respond writes in
with Spring MVC's ContentNegotiationManager, as the formats grails.mime.types
gives the media types it resolves:

- The Accept header is read by Spring MVC's manager, with its strategies and
  spring.mvc.contentnegotiation.*, in its order: quality, then specificity, then
  the order of the header. The text/xml merge and the +xml preference are gone.
- A type with the +json or +xml suffix that no configured type names is the json
  or xml format, as Spring MVC's converters write such types; this extends the
  rule Grails 9 had for the problem types of RFC 9457.
- */* is the all format, also where it is not configured. Another wildcard, such
  as text/*, is a type of the all format that withFormat answers with its first
  block, and respond with the first of the action's formats, whose format has a
  type compatible with it.
- A request that accepts no configured type, or whose Accept header Spring cannot
  read, has no format: response.format is null, respond answers 406 and withFormat
  runs its * block or none.
- The format parameter and URL extensions are kept, ahead of Spring MVC's
  strategies; an unknown format is not acceptable and all leaves the format to
  the Accept header. request.format reads Content-Type with Spring's parser.

The format parameter, URL extensions and the grails.mime Accept header settings
are installed into Spring MVC's manager, by a post-processor that replaces the
mvcContentNegotiationManager bean with the setting only, as strategies that apply
while a URL mapping handles the request, so that what Spring MVC writes for an
action, such as a ResponseEntity or a ProblemDetail, is negotiated as Grails
resolves its format. Spring MVC endpoints and Spring Security, before a mapping
has matched the request, negotiate as before, and GrailsContentNegotiationStrategy
is still no Spring ContentNegotiationStrategy bean. A web unit test marks the
request of the action it calls as handled by a URL mapping, as in an application.

Without the setting, every answer is that of Grails 9.
…type

ReflectionUtils.matchAllUrlMappings read the version of the response type, which
grails.mime.negotiation.spring resolves to none for a request that accepts no
configured type, such as one that sends only Accept: image/png, so every such
request failed in the security filter with a NullPointerException. It now matches
any version, as for a type without one.
FormatNegotiationComparisonSpec runs a matrix of requests a URL mapping handles
through both policies, with and without grails.mime.negotiation.spring, under
several grails.mime.types and Accept header configurations: Accept headers with
qualities, wildcards and +json/+xml types, browser and XHR user agents, the format
parameter, and Content-Type. It records each answer that differs, from
response.format, withFormat, request.format and the media types Spring MVC's
manager resolves for what it writes, so that a change to either policy that
changes an answer fails it, and checks that with the setting the first type the
manager resolves is of the format Grails resolves.
app1 answers the same requests with and without grails.mime.negotiation.spring:
a ResponseEntity an action returns is written in the format of its URL
extension, or not acceptable where no converter writes it so, an unknown format
is not acceptable, the formats Grails resolves follow Spring MVC's order, a +json
body is of the json format, and a Spring MVC endpoint keeps its negotiation.
The content negotiation guide describes how the setting resolves formats with
Spring MVC's manager and what becomes of each Grails rule: kept, extended or
dropped. The new Upgrading from Grails 9 to Grails 10 section lists the answers
that change, which FormatNegotiationComparisonSpec records, and the built-in
properties list the setting.
The setting is opt-in in Grails 9, and Grails 10 makes it the default, as it does
for the other migration settings in grails.config.Settings: the new API is
@SInCE 9.0, the upgrade notes are section 22 of Upgrading from Grails 8 to Grails
9, which the content negotiation guide and What's New point to, and the settings
documentation gives its default as false in Grails 9 and true from Grails 10.
A forward an action makes is a dispatch of its own, which Spring MVC's handler
mappings match after the URL mappings, while the mapping of the forwarding
dispatch was still the request's best matching handler. With
grails.mime.negotiation.spring, the produces condition of an endpoint was then
matched on the format the action was asked for: /book/forward?format=xml to an
endpoint that produces JSON answered 406 for a client that accepts JSON. The URL
mappings now take a mapping an earlier dispatch left off the request when they
match no handler for the dispatch.
The post-processor that replaces Spring MVC's content negotiation manager read
the setting from the Spring Environment, while the strategy that resolves Grails
formats read it from the application's configuration. A configuration that is not
the environment, as one a test builds by hand or one code changes, could then
enable one half of the setting without the other: Grails formats resolved with
Spring MVC's manager while what Spring MVC writes ignored the Grails rules, or the
other way round. Both now read the application's configuration.
The functional spec with grails.mime.negotiation.spring ran in app1 with
@TestPropertySource, which starts a second application context in the test JVM.
GORM's static API then answered for that context, so the GORM specs of app1 that
ran after it failed with "No Session found for current thread". The spec moves to
grails-test-examples/spring-format-negotiation, whose application.yml sets the
setting, with the Spring MVC endpoint and the actions it calls; app1 keeps the
spec of the Grails rules, which runs in its own context.
@codeconsole
codeconsole requested review from jamesfredley, jdaugherty, matrei and sbglasius and removed request for matrei November 14, 2026 21:33

@jamesfredley jamesfredley 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.

Requested changes. A request that used to select atom now selects xml. Reading the format for an accept-all header can then make a later respond return 406.

With grails.mime.negotiation.spring and a grails.mime.types that does not list
all, a client that accepts any type resolves to the all format, which reading
response.format saves as the response format. respond then resolved that saved
format to no type, and answered 406: the all format is now */*, any type, as
Spring MVC reads it, whether or not grails.mime.types lists it. ?format=all then
leaves the format to the Accept header there too, for Grails formats and for what
Spring MVC writes.
grails.mime.negotiation.spring took the types of the Accept header in Spring
MVC's order alone, so Accept: application/xml, application/atom+xml resolved to
xml where the Grails rules resolve it to atom. A type with the +xml suffix of the
quality of the first application/xml or text/xml now comes ahead of it, each one
later in the header in front of those before it, as the Grails rules order them,
for Grails formats and, for a request a URL mapping handles, for what Spring MVC
writes. The comparison record loses the atom answers, and the guide and upgrade
notes list the rule as kept; they also describe the all format of the previous
commit.
@codeconsole

Copy link
Copy Markdown
Contributor Author

@jamesfredley

  • f314e84: the +xml preference is kept (inline reply).
  • 1f5f19f: with a grails.mime.types that does not list all, reading response.format for Accept: */*, or no Accept, saved all, which then resolved to no type, so respond answered 406. The all format is now */* whether or not it is configured, and ?format=all leaves the format to the Accept header there too.

@jamesfredley jamesfredley 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.

Requested changes. A more specific xml type stays ahead of xml, and an accept-all header no longer makes a later respond fail. format=all is still read again and the response is 406.

…otiation

With spring.mvc.contentnegotiation.favor-parameter, Spring MVC's parameter
negotiation reads the format parameter, as Grails does. Grails left the all
format to the Accept header, and the parameter strategy then read the same
parameter again and found all not acceptable: ?format=all with Accept:
application/json answered 406 to respond and to what Spring MVC writes for the
action. For a request a URL mapping handles, Grails now reads the format
parameter in place of that strategy, so all is left to the Accept header; a
Spring MVC endpoint still reads it with Spring MVC's parameter negotiation.

@jamesfredley jamesfredley 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.

The items this review found have been addressed. format=all is left to the Accept header, a more specific xml type stays ahead of xml, and an accept-all header does not make a later respond fail.

@codecov

codecov Bot commented Nov 17, 2026 •

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 80.13468% with 59 lines in your changes missing coverage. Please review.
✅ Project coverage is 65.5250%. Comparing base (c4d4c59) to head (5065b39).

Files with missing lines Patch % Lines
...s/web/mime/GrailsContentNegotiationStrategy.groovy 75.8170% 5 Missing and 32 partials ⚠️
.../grails/plugins/web/api/MimeTypesApiSupport.groovy 81.8182% 1 Missing and 5 partials ⚠️
...ls/web/mime/GrailsContentNegotiationManager.groovy 79.1667% 2 Missing and 3 partials ⚠️
...rails/web/mime/HttpServletResponseExtension.groovy 73.3333% 0 Missing and 4 partials ⚠️
...railsAcceptHeaderContentNegotiationStrategy.groovy 81.8182% 1 Missing and 1 partial ⚠️
...mime/GrailsFormatContentNegotiationStrategy.groovy 86.6667% 0 Missing and 2 partials ⚠️
...vy/grails/artefact/controller/RestResponder.groovy 0.0000% 0 Missing and 2 partials ⚠️
...railsContentNegotiationManagerPostProcessor.groovy 90.0000% 0 Missing and 1 partial ⚠️
Additional details and impacted files

Impacted file tree graph

@@                Coverage Diff                 @@
##                9.0.x     #16996        +/-   ##
==================================================
+ Coverage     65.4950%   65.5250%   +0.0299%     
- Complexity      32667      32846       +179     
==================================================
  Files            2439       2443         +4     
  Lines          120968     121221       +253     
  Branches        22402      22483        +81     
==================================================
+ Hits            79228      79430       +202     
- Misses          31732      31744        +12     
- Partials        10008      10047        +39     
Files with missing lines Coverage Δ
...core/src/main/groovy/grails/config/Settings.groovy 100.0000% <ø> (ø)
...ils/plugins/web/mime/MimeTypesConfiguration.groovy 86.2745% <100.0000%> (+1.1681%) ⬆️
...grails/web/mime/HttpServletRequestExtension.groovy 93.5484% <100.0000%> (+1.2407%) ⬆️
...groovy/grails/testing/web/GrailsWebUnitTest.groovy 100.0000% <ø> (ø)
...ing/UrlMappingsBeanDefinitionsPostProcessor.groovy 89.3617% <100.0000%> (+1.2665%) ⬆️
...plugins/web/mapping/UrlMappingsGrailsPlugin.groovy 47.3684% <100.0000%> (+2.9240%) ⬆️
...s/web/mapping/mvc/UrlMappingsHandlerMapping.groovy 81.3433% <100.0000%> (+3.8433%) ⬆️
...railsContentNegotiationManagerPostProcessor.groovy 90.0000% <90.0000%> (ø)
...railsAcceptHeaderContentNegotiationStrategy.groovy 81.8182% <81.8182%> (ø)
...mime/GrailsFormatContentNegotiationStrategy.groovy 86.6667% <86.6667%> (ø)
... and 5 more

... and 7 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@github-actions
github-actions Bot dismissed matrei’s stale review November 18, 2026 22:54

Dismissed automatically: the pull request changed after this approval, from 1b6dc63 to c903885.

@jamesfredley jamesfredley 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.

Requested changes. A format registered only with Spring MVC is rejected when the request asks for it by name.

For a request a URL mapping handles, Grails reads the format parameter and
the URL extension in place of Spring MVC's parameter strategy, and rejected a
format grails.mime.types does not list before Spring MVC could map it: with
spring.mvc.contentnegotiation.media-types.plain: text/plain, ?format=plain or
.plain with Accept: application/json answered 406 for a ResponseEntity the
action returns. A format grails.mime.types does not list is now the type
Spring MVC's content negotiation manager maps it to, with or without
favor-parameter, and only a format neither maps is not acceptable. A format
Grails configures keeps its own types, and respond still answers 406 for a
format only Spring MVC maps, since Grails has no type of it to render. The
guide, the upgrade notes and the grails-upgrade skill say so.
sbglasius
sbglasius previously approved these changes Nov 19, 2026

@sbglasius sbglasius 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.

This is an AI assisted review

Approving. The earlier threads (atom/+xml order, ?format=all, Spring-only formats) are resolved, and the comparison spec plus upgrade-guide section 26 document the behaviour well. A few non-blocking points:

  1. UrlMappingsHandlerMapping and GrailsWebUnitTest now set HandlerMapping.BEST_MATCHING_HANDLER_ATTRIBUTE even when grails.mime.negotiation.spring is off. Only the new strategies read it, so setting it only when the setting is on would keep the default fully as in Grails 9.
  2. HttpServletRequestExtension.getMimeTypes calls GrailsContentNegotiationStrategy.forRequest() before it checks the setting, and RestResponder.respond calls it on every respond. Storing the strategy, or just the flag, on the request would avoid the repeated lookups.
  3. The post-processor and the strategy each read the setting on their own. Having the post-processor read it from the strategy would keep the two from ever disagreeing.

@jamesfredley jamesfredley 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.

The items this review found have been addressed. A format registered only with Spring MVC is written in the type Spring MVC maps it to.

GrailsContentNegotiationStrategy.forRequest looked the strategy up in the
application context on every call, and, in a context without
MimeTypesConfiguration, such as one a test builds by hand, built a new one
each time. request.format, response.format, response.mimeType, withFormat and
respond each call it, also without grails.mime.negotiation.spring, since the
setting is only known through the strategy. The strategy is now kept as an
attribute of the request it was resolved for, so each request looks it up
once, for every caller, and the RestResponder trait gets no field.
…tion.spring

UrlMappingsHandlerMapping set BEST_MATCHING_HANDLER_ATTRIBUTE to the mapping
it matched, and put an interceptor that takes it off first in every handler
chain, and a web unit test set it for the action it calls, whatever the
setting said. Only the content negotiation strategies the setting installs
read it. The handler mapping now does both only where markHandledRequests is
set, which the URL mappings plugin sets from grails.mime.negotiation.spring in
the Grails configuration, as the negotiation reads it, and a web unit test
sets the attribute only with the setting. Without it, the handler chain and
the request attributes are those of 9.0.x.
@codeconsole

Copy link
Copy Markdown
Contributor Author

@sbglasius

  • c960808: UrlMappingsHandlerMapping sets BEST_MATCHING_HANDLER_ATTRIBUTE, and adds the interceptor that takes it off, only where markHandledRequests is set. The URL mappings plugin sets it from grails.mime.negotiation.spring in the Grails configuration, and a web unit test sets the attribute only with the setting. Without the setting, the handler chain and the request attributes are those of 9.0.x.
  • d083eda: GrailsContentNegotiationStrategy.forRequest keeps the strategy it resolves as a request attribute, so request.format, response.format, withFormat and respond look it up once per request, and RestResponder gets no field.
  • 3 is unchanged. The post-processor runs while mvcContentNegotiationManager is being created. Asking the strategy then would build it, and building it pulls in every MimeTypeProvider, renderers included, which can depend on that manager (see GrailsMimeTypesWebMvcConfigurer and MimeTypesConfiguration). Every reader of the setting takes it from grailsApplication.config since a13c489, and SpringFormatNegotiationSpec checks that they agree when the environment says otherwise.

@github-actions
github-actions Bot dismissed sbglasius’s stale review November 19, 2026 19:06

Dismissed automatically: the pull request changed after this approval, from a7ae6fc to c960808.

@jdaugherty jdaugherty 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.

Reviewed at 66e1fae against 9.0.x. No blocking code findings; one non-blocking documentation correction below.

The earlier fixes for +xml ordering, accept-all format caching, format=all with Spring parameter negotiation, and formats registered only with Spring MVC are present and covered by passing tests. The latest changes also gate the handler marker on the setting and retain the negotiation strategy per request.

Validation on Java 21, with --offline --no-configuration-cache:

  • Full test tasks for grails-mimetypes, grails-web-url-mappings, grails-url-mappings and grails-rest-transforms: 934 passed, 1 skipped, no failures (including the URL-mapping CLI tests).
  • grails-test-suite-web negotiation specs and MigrationSettingsMetadataSpec: 36 passed.
  • grails-test-examples-spring-format-negotiation integration tests: 12 passed.

The Groovy Snapshot Canary failure log shows static type-checking errors in unchanged code, including GrailsApplicationPostProcessor, RxPromiseFactory and Tenants; those are separate from this change.

`grails.mime` settings of the `Accept` header decide what Spring MVC writes for an action too, such as a
`ResponseEntity` it returns. See <<springFormatNegotiation,Resolving Formats with Spring MVC Content Negotiation>>.

See xref:upgrading#upgrading90x[Upgrading from Grails 8 to Grails 9], sections 4 to 11, 13 to 16 and 26.

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.

[P3] Link the content-negotiation upgrade note by its anchor. This still sends readers to section 26, which now covers domain-class events in unit tests. The content-negotiation note is numbered 29 in the current head. Please use the new upgradingSpringFormatNegotiation anchor for this reference, or update the number; using the anchor would avoid another stale reference after a merge renumbers the guide.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Fixed in 5065b39. What's New links the note by the upgradingSpringFormatNegotiation anchor; after the 9.0.x merge (e93a970) it is section 31. The other sections in that sentence had moved by two when 9.0.x added sections 2 and 3, so they now read 6 to 13 and 15 to 18.

9.0.x numbered the notes of JLine 4 and of the command lines of
application commands 29 and 30, so the upgrade notes of
grails.mime.negotiation.spring are now section 31.
What's New still named section 26 for the upgrade notes of
grails.mime.negotiation.spring, which 9.0.x has renumbered twice since; they
are now section 31. It links them by their anchor,
upgradingSpringFormatNegotiation, so a renumbering cannot leave the
reference stale again. The other sections the sentence lists moved by two
when 9.0.x added the Spring Boot 4.2 and graphql-java 26 notes as sections
2 and 3, so they are now 6 to 13 and 15 to 18.
@testlens-app

testlens-app Bot commented Nov 20, 2026 •

Copy link
Copy Markdown

🚨 TestLens detected 56 failed tests 🚨

Failed Jobs without Test Failures

❌ CI / Hibernate7 Functional Tests (Java 25, indy=false)
❌ Groovy Snapshot Canary Build / Build Grails (shard 0)
❌ Groovy Snapshot Canary Build / Build Grails (shard 1)
❌ Groovy Snapshot Canary Build / Build Grails (shard 2)

Test Summary

Tip

Inspect all details with the TestLens CLI: testlens pr 16996

CI / Functional Tests (Java 21, indy=false) > :grails-test-examples-issue-11102:integrationTest

Test Runs Flakiness
FailedActionObservationSpec > a failed action answered by #handler is reported once with its own exception and route > a failed action answered by an error controller, after an asynchronous forward from Spring MVC is reported once with its own exception and route ❌ 0% 🟢
FailedActionObservationSpec > a failed action answered by #handler is reported once with its own exception and route > a failed action answered by an error controller, after an asynchronous forward from an action is reported once with its own exception and route ❌ 0% 🟢
FailedActionObservationSpec > a failed action answered by #handler is reported once with its own exception and route > a failed action answered by an error controller, after starting async is reported once with its own exception and route ❌ 0% 🟢
FailedActionObservationSpec > a failed action answered by #handler is reported once with its own exception and route > a failed action answered by an error controller, asynchronously is reported once with its own exception and route ❌ 0% 🟢
FailedActionObservationSpec > a failed action answered by #handler is reported once with its own exception and route > a failed action answered by the error view, after starting async is reported once with its own exception and route ❌ 0% 🟢

CI / Functional Tests (Java 21, indy=false, shard 1) > :grails-test-examples-jetty:integrationTest

Test Runs Flakiness
JettyFailedActionObservationSpec > a failed action answered by #handler is reported once with its own exception and route > a failed action answered by an error controller, after an asynchronous forward from Spring MVC is reported once with its own exception and route ❌ 0% 🟢
JettyFailedActionObservationSpec > a failed action answered by #handler is reported once with its own exception and route > a failed action answered by an error controller, after an asynchronous forward from an action is reported once with its own exception and route ❌ 0% 🟢
JettyFailedActionObservationSpec > a failed action answered by #handler is reported once with its own exception and route > a failed action answered by an error controller, after starting async is reported once with its own exception and route ❌ 0% 🟢
JettyFailedActionObservationSpec > a failed action answered by #handler is reported once with its own exception and route > a failed action answered by an error controller, asynchronously is reported once with its own exception and route ❌ 0% 🟢
JettyFailedActionObservationSpec > a failed action answered by #handler is reported once with its own exception and route > a failed action answered by the error view, after starting async is reported once with its own exception and route ❌ 0% 🟢

CI / Functional Tests (Java 21, indy=false, shard 1) > :grails-test-examples-undertow:integrationTest

Test Runs Flakiness
UndertowFailedActionObservationSpec > a failed action answered by #handler is reported once with its own exception and route > a failed action answered by an error controller, after an asynchronous forward from Spring MVC is reported once with its own exception and route ❌ 0% 🟢
UndertowFailedActionObservationSpec > a failed action answered by #handler is reported once with its own exception and route > a failed action answered by an error controller, after an asynchronous forward from an action is reported once with its own exception and route ❌ 0% 🟢
UndertowFailedActionObservationSpec > a failed action answered by #handler is reported once with its own exception and route > a failed action answered by an error controller, asynchronously is reported once with its own exception and route ❌ 0% 🟢
UndertowFailedActionObservationSpec > a failed action answered by #handler is reported once with its own exception and route > a failed action answered by the error view, after starting async is reported once with its own exception and route ❌ 0% 🟢

CI / Functional Tests (Java 21, indy=true) > :grails-test-examples-issue-11102:integrationTest

Test Runs Flakiness
FailedActionObservationSpec > a failed action answered by #handler is reported once with its own exception and route > a failed action answered by an error controller, after an asynchronous forward from Spring MVC is reported once with its own exception and route ❌ 0% 🟢
FailedActionObservationSpec > a failed action answered by #handler is reported once with its own exception and route > a failed action answered by an error controller, after an asynchronous forward from an action is reported once with its own exception and route ❌ 0% 🟢
FailedActionObservationSpec > a failed action answered by #handler is reported once with its own exception and route > a failed action answered by an error controller, after starting async is reported once with its own exception and route ❌ 0% 🟢
FailedActionObservationSpec > a failed action answered by #handler is reported once with its own exception and route > a failed action answered by an error controller, asynchronously is reported once with its own exception and route ❌ 0% 🟢
FailedActionObservationSpec > a failed action answered by #handler is reported once with its own exception and route > a failed action answered by the error view, after starting async is reported once with its own exception and route ❌ 0% 🟢

CI / Functional Tests (Java 21, indy=true, shard 1) > :grails-test-examples-jetty:integrationTest

Test Runs Flakiness
JettyFailedActionObservationSpec > a failed action answered by #handler is reported once with its own exception and route > a failed action answered by an error controller, after an asynchronous forward from Spring MVC is reported once with its own exception and route ❌ 0% 🟢
JettyFailedActionObservationSpec > a failed action answered by #handler is reported once with its own exception and route > a failed action answered by an error controller, after an asynchronous forward from an action is reported once with its own exception and route ❌ 0% 🟢
JettyFailedActionObservationSpec > a failed action answered by #handler is reported once with its own exception and route > a failed action answered by an error controller, after starting async is reported once with its own exception and route ❌ 0% 🟢
JettyFailedActionObservationSpec > a failed action answered by #handler is reported once with its own exception and route > a failed action answered by an error controller, asynchronously is reported once with its own exception and route ❌ 0% 🟢
JettyFailedActionObservationSpec > a failed action answered by #handler is reported once with its own exception and route > a failed action answered by the error view, after starting async is reported once with its own exception and route ❌ 0% 🟢

CI / Functional Tests (Java 21, indy=true, shard 1) > :grails-test-examples-undertow:integrationTest

Test Runs Flakiness
UndertowFailedActionObservationSpec > a failed action answered by #handler is reported once with its own exception and route > a failed action answered by an error controller, after an asynchronous forward from Spring MVC is reported once with its own exception and route ❌ 0% 🟢
UndertowFailedActionObservationSpec > a failed action answered by #handler is reported once with its own exception and route > a failed action answered by an error controller, after an asynchronous forward from an action is reported once with its own exception and route ❌ 0% 🟢
UndertowFailedActionObservationSpec > a failed action answered by #handler is reported once with its own exception and route > a failed action answered by an error controller, asynchronously is reported once with its own exception and route ❌ 0% 🟢
UndertowFailedActionObservationSpec > a failed action answered by #handler is reported once with its own exception and route > a failed action answered by the error view, after starting async is reported once with its own exception and route ❌ 0% 🟢

CI / Functional Tests (Java 25, indy=false) > :grails-test-examples-issue-11102:integrationTest

Test Runs Flakiness
FailedActionObservationSpec > a failed action answered by #handler is reported once with its own exception and route > a failed action answered by an error controller, after an asynchronous forward from Spring MVC is reported once with its own exception and route ❌ 0% 🟢
FailedActionObservationSpec > a failed action answered by #handler is reported once with its own exception and route > a failed action answered by an error controller, after an asynchronous forward from an action is reported once with its own exception and route ❌ 0% 🟢
FailedActionObservationSpec > a failed action answered by #handler is reported once with its own exception and route > a failed action answered by an error controller, after starting async is reported once with its own exception and route ❌ 0% 🟢
FailedActionObservationSpec > a failed action answered by #handler is reported once with its own exception and route > a failed action answered by an error controller, asynchronously is reported once with its own exception and route ❌ 0% 🟢
FailedActionObservationSpec > a failed action answered by #handler is reported once with its own exception and route > a failed action answered by the error view, after starting async is reported once with its own exception and route ❌ 0% 🟢

CI / Functional Tests (Java 25, indy=false, shard 1) > :grails-test-examples-jetty:integrationTest

Test Runs Flakiness
JettyFailedActionObservationSpec > a failed action answered by #handler is reported once with its own exception and route > a failed action answered by an error controller, after an asynchronous forward from Spring MVC is reported once with its own exception and route ❌ 0% 🟢
JettyFailedActionObservationSpec > a failed action answered by #handler is reported once with its own exception and route > a failed action answered by an error controller, after an asynchronous forward from an action is reported once with its own exception and route ❌ 0% 🟢
JettyFailedActionObservationSpec > a failed action answered by #handler is reported once with its own exception and route > a failed action answered by an error controller, after starting async is reported once with its own exception and route ❌ 0% 🟢
JettyFailedActionObservationSpec > a failed action answered by #handler is reported once with its own exception and route > a failed action answered by an error controller, asynchronously is reported once with its own exception and route ❌ 0% 🟢
JettyFailedActionObservationSpec > a failed action answered by #handler is reported once with its own exception and route > a failed action answered by the error view, after starting async is reported once with its own exception and route ❌ 0% 🟢

CI / Functional Tests (Java 25, indy=false, shard 1) > :grails-test-examples-undertow:integrationTest

Test Runs Flakiness
UndertowFailedActionObservationSpec > a failed action answered by #handler is reported once with its own exception and route > a failed action answered by an error controller, after an asynchronous forward from Spring MVC is reported once with its own exception and route ❌ 0% 🟢
UndertowFailedActionObservationSpec > a failed action answered by #handler is reported once with its own exception and route > a failed action answered by an error controller, after an asynchronous forward from an action is reported once with its own exception and route ❌ 0% 🟢
UndertowFailedActionObservationSpec > a failed action answered by #handler is reported once with its own exception and route > a failed action answered by an error controller, asynchronously is reported once with its own exception and route ❌ 0% 🟢
UndertowFailedActionObservationSpec > a failed action answered by #handler is reported once with its own exception and route > a failed action answered by the error view, after starting async is reported once with its own exception and route ❌ 0% 🟢

SiteMesh 2 Compatibility / SiteMesh 2 Functional Tests (Java 21, indy=false) > :grails-test-examples-issue-11102:integrationTest

Test Runs Flakiness
FailedActionObservationSpec > a failed action answered by #handler is reported once with its own exception and route > a failed action answered by an error controller, after an asynchronous forward from Spring MVC is reported once with its own exception and route ❌ 0% 🟢
FailedActionObservationSpec > a failed action answered by #handler is reported once with its own exception and route > a failed action answered by an error controller, after an asynchronous forward from an action is reported once with its own exception and route ❌ 0% 🟢
FailedActionObservationSpec > a failed action answered by #handler is reported once with its own exception and route > a failed action answered by an error controller, after starting async is reported once with its own exception and route ❌ 0% 🟢
FailedActionObservationSpec > a failed action answered by #handler is reported once with its own exception and route > a failed action answered by an error controller, asynchronously is reported once with its own exception and route ❌ 0% 🟢
FailedActionObservationSpec > a failed action answered by #handler is reported once with its own exception and route > a failed action answered by the error view, after starting async is reported once with its own exception and route ❌ 0% 🟢

SiteMesh 2 Compatibility / SiteMesh 2 Functional Tests (Java 21, indy=false) > :grails-test-examples-jetty:integrationTest

Test Runs Flakiness
JettyFailedActionObservationSpec > a failed action answered by #handler is reported once with its own exception and route > a failed action answered by an error controller, after an asynchronous forward from Spring MVC is reported once with its own exception and route ❌ 0% 🟢
JettyFailedActionObservationSpec > a failed action answered by #handler is reported once with its own exception and route > a failed action answered by an error controller, after an asynchronous forward from an action is reported once with its own exception and route ❌ 0% 🟢
JettyFailedActionObservationSpec > a failed action answered by #handler is reported once with its own exception and route > a failed action answered by an error controller, after starting async is reported once with its own exception and route ❌ 0% 🟢
JettyFailedActionObservationSpec > a failed action answered by #handler is reported once with its own exception and route > a failed action answered by an error controller, asynchronously is reported once with its own exception and route ❌ 0% 🟢
JettyFailedActionObservationSpec > a failed action answered by #handler is reported once with its own exception and route > a failed action answered by the error view, after starting async is reported once with its own exception and route ❌ 0% 🟢

SiteMesh 2 Compatibility / SiteMesh 2 Functional Tests (Java 21, indy=false) > :grails-test-examples-undertow:integrationTest

Test Runs Flakiness
UndertowFailedActionObservationSpec > a failed action answered by #handler is reported once with its own exception and route > a failed action answered by an error controller, after an asynchronous forward from Spring MVC is reported once with its own exception and route ❌ 0% 🟢
UndertowFailedActionObservationSpec > a failed action answered by #handler is reported once with its own exception and route > a failed action answered by an error controller, after an asynchronous forward from an action is reported once with its own exception and route ❌ 0% 🟢
UndertowFailedActionObservationSpec > a failed action answered by #handler is reported once with its own exception and route > a failed action answered by an error controller, asynchronously is reported once with its own exception and route ❌ 0% 🟢
UndertowFailedActionObservationSpec > a failed action answered by #handler is reported once with its own exception and route > a failed action answered by the error view, after starting async is reported once with its own exception and route ❌ 0% 🟢

🏷️ Commit: 5065b39
▶️ Tests: 138015 executed
⚪️ Checks: 100/100 completed

Test Failures (first 10 of 56)

FailedActionObservationSpec > a failed action answered by #handler is reported once with its own exception and route > a failed action answered by an error controller, after an asynchronous forward from Spring MVC is reported once with its own exception and route (:grails-test-examples-issue-11102:integrationTest in CI / Functional Tests (Java 21, indy=false))
Condition not satisfied:

NOTIFIED[path] == [exception]
|       ||     |   |
|       ||     |   UnsupportedOperationException
|       ||     false
|       |/spring/forwardedToControllerAsynchronously
|       [UnsupportedOperationException, UnsupportedOperationException]
[/failing/answeredByView:[IllegalStateException], /failing/forwardedToController:[UnsupportedOperationException], /failing/answeredByViewAsynchronously:[IllegalStateException], /failing/forwardedToView:[IllegalStateException], /failing/answeredByController:[UnsupportedOperationException], /failing/answeredByControllerAsynchronously:[UnsupportedOperationException, UnsupportedOperationException], /failing/answeredByViewAfterStartingAsync:[IllegalStateException, AsyncRequestTimeoutException], /spring/forwardedToViewAsynchronously:[IllegalStateException], /failing/answeredByControllerAfterStartingAsync:[UnsupportedOperationException, ControllerExecutionException], /spring/forwardedToControllerAsynchronously:[UnsupportedOperationException, UnsupportedOperationException]]

	at issue11102.FailedActionObservationSpec.a failed action answered by #handler is reported once with its own exception and route(FailedActionObservationSpec.groovy:79)
expected actual
UnsupportedOperationException UnsupportedOperationException
UnsupportedOperationException
FailedActionObservationSpec > a failed action answered by #handler is reported once with its own exception and route > a failed action answered by an error controller, after an asynchronous forward from an action is reported once with its own exception and route (:grails-test-examples-issue-11102:integrationTest in CI / Functional Tests (Java 21, indy=false))
Condition not satisfied:

NOTIFIED[path] == [exception]
|       ||     |   |
|       ||     |   UnsupportedOperationException
|       ||     false
|       |/failing/forwardedToControllerAsynchronously
|       [UnsupportedOperationException, UnsupportedOperationException]
[/failing/forwardedToControllerAsynchronously:[UnsupportedOperationException, UnsupportedOperationException], /failing/answeredByViewAsynchronously:[IllegalStateException], /failing/forwardedToView:[IllegalStateException], /failing/answeredByControllerAsynchronously:[UnsupportedOperationException, UnsupportedOperationException], /spring/forwardedToViewAsynchronously:[IllegalStateException], /spring/forwardedToControllerAsynchronously:[UnsupportedOperationException, UnsupportedOperationException], /failing/answeredByView:[IllegalStateException], /failing/forwardedToController:[UnsupportedOperationException], /failing/answeredByController:[UnsupportedOperationException], /failing/forwardedToViewAsynchronously:[IllegalStateException], /failing/answeredByViewAfterStartingAsync:[IllegalStateException, AsyncRequestTimeoutException], /failing/answeredByControllerAfterStartingAsync:[UnsupportedOperationException, ControllerExecutionException]]

	at issue11102.FailedActionObservationSpec.a failed action answered by #handler is reported once with its own exception and route(FailedActionObservationSpec.groovy:79)
expected actual
UnsupportedOperationException UnsupportedOperationException
UnsupportedOperationException
FailedActionObservationSpec > a failed action answered by #handler is reported once with its own exception and route > a failed action answered by an error controller, after starting async is reported once with its own exception and route (:grails-test-examples-issue-11102:integrationTest in CI / Functional Tests (Java 21, indy=false))
Condition not satisfied after 30.00 seconds and 307 attempts
	at spock.util.concurrent.PollingConditions.within(PollingConditions.java:205)
	at spock.util.concurrent.PollingConditions.eventually(PollingConditions.java:157)
	at issue11102.FailedActionObservationSpec.a failed action answered by #handler is reported once with its own exception and route(FailedActionObservationSpec.groovy:73)
Caused by: Condition not satisfied:

STOPPED[path] == [route, exception]
|      ||     |   |      |
|      ||     |   |      UnsupportedOperationException
|      ||     |   /failing/answeredByControllerAfterStartingAsync
|      ||     false
|      |/failing/answeredByControllerAfterStartingAsync
|      [/failing/answeredByControllerAfterStartingAsync, ControllerExecutionException]
[/failing/answeredByView:[/failing/answeredByView, IllegalStateException], /failing/answeredByViewAsynchronously:[/failing/answeredByViewAsynchronously, IllegalStateException], /failing/answeredByController:[/failing/answeredByController, UnsupportedOperationException], /failing/answeredByControllerAsynchronously:[/failing/answeredByControllerAsynchronously, UnsupportedOperationException], /failing/answeredByViewAfterStartingAsync:[/failing/answeredByViewAfterStartingAsync, AsyncRequestTimeoutException], /failing/answeredByControllerAfterStartingAsync:[/failing/answeredByControllerAfterStartingAsync, ControllerExecutionException]]

	at issue11102.FailedActionObservationSpec.a failed action answered by #handler is reported once with its own exception and route_closure1(FailedActionObservationSpec.groovy:74)
	at issue11102.FailedActionObservationSpec.a failed action answered by #handler is reported once with its own exception and route_closure1(FailedActionObservationSpec.groovy)
	at spock.util.concurrent.PollingConditions.within(PollingConditions.java:185)
	... 2 more
FailedActionObservationSpec > a failed action answered by #handler is reported once with its own exception and route > a failed action answered by an error controller, asynchronously is reported once with its own exception and route (:grails-test-examples-issue-11102:integrationTest in CI / Functional Tests (Java 21, indy=false))
Condition not satisfied:

NOTIFIED[path] == [exception]
|       ||     |   |
|       ||     |   UnsupportedOperationException
|       ||     false
|       |/failing/answeredByControllerAsynchronously
|       [UnsupportedOperationException, UnsupportedOperationException]
[/failing/answeredByView:[IllegalStateException], /failing/answeredByViewAsynchronously:[IllegalStateException], /failing/answeredByController:[UnsupportedOperationException], /failing/answeredByControllerAsynchronously:[UnsupportedOperationException, UnsupportedOperationException]]

	at issue11102.FailedActionObservationSpec.a failed action answered by #handler is reported once with its own exception and route(FailedActionObservationSpec.groovy:79)
expected actual
UnsupportedOperationException UnsupportedOperationException
UnsupportedOperationException
FailedActionObservationSpec > a failed action answered by #handler is reported once with its own exception and route > a failed action answered by the error view, after starting async is reported once with its own exception and route (:grails-test-examples-issue-11102:integrationTest in CI / Functional Tests (Java 21, indy=false))
Condition not satisfied after 30.00 seconds and 329 attempts
	at spock.util.concurrent.PollingConditions.within(PollingConditions.java:205)
	at spock.util.concurrent.PollingConditions.eventually(PollingConditions.java:157)
	at issue11102.FailedActionObservationSpec.a failed action answered by #handler is reported once with its own exception and route(FailedActionObservationSpec.groovy:73)
Caused by: Condition not satisfied:

STOPPED[path] == [route, exception]
|      ||     |   |      |
|      ||     |   |      IllegalStateException
|      ||     |   /failing/answeredByViewAfterStartingAsync
|      ||     false
|      |/failing/answeredByViewAfterStartingAsync
|      [/failing/answeredByViewAfterStartingAsync, AsyncRequestTimeoutException]
[/failing/answeredByView:[/failing/answeredByView, IllegalStateException], /failing/answeredByViewAsynchronously:[/failing/answeredByViewAsynchronously, IllegalStateException], /failing/answeredByController:[/failing/answeredByController, UnsupportedOperationException], /failing/answeredByControllerAsynchronously:[/failing/answeredByControllerAsynchronously, UnsupportedOperationException], /failing/answeredByViewAfterStartingAsync:[/failing/answeredByViewAfterStartingAsync, AsyncRequestTimeoutException]]

	at issue11102.FailedActionObservationSpec.a failed action answered by #handler is reported once with its own exception and route_closure1(FailedActionObservationSpec.groovy:74)
	at issue11102.FailedActionObservationSpec.a failed action answered by #handler is reported once with its own exception and route_closure1(FailedActionObservationSpec.groovy)
	at spock.util.concurrent.PollingConditions.within(PollingConditions.java:185)
	... 2 more
JettyFailedActionObservationSpec > a failed action answered by #handler is reported once with its own exception and route > a failed action answered by an error controller, after an asynchronous forward from Spring MVC is reported once with its own exception and route (:grails-test-examples-jetty:integrationTest in CI / Functional Tests (Java 21, indy=false, shard 1))
Condition not satisfied:

NOTIFIED[path] == [exception]
|       ||     |   |
|       ||     |   UnsupportedOperationException
|       ||     false
|       |/spring/forwardedToControllerAsynchronously
|       [UnsupportedOperationException, UnsupportedOperationException]
[/failing/answeredByView:[IllegalStateException], /failing/forwardedToController:[UnsupportedOperationException], /failing/answeredByViewAsynchronously:[IllegalStateException], /failing/forwardedToView:[IllegalStateException], /failing/answeredByController:[UnsupportedOperationException], /failing/answeredByControllerAsynchronously:[UnsupportedOperationException, UnsupportedOperationException], /failing/answeredByViewAfterStartingAsync:[IllegalStateException, AsyncRequestTimeoutException], /spring/forwardedToViewAsynchronously:[IllegalStateException], /failing/answeredByControllerAfterStartingAsync:[UnsupportedOperationException, UnsupportedOperationException], /spring/forwardedToControllerAsynchronously:[UnsupportedOperationException, UnsupportedOperationException]]

	at issue12688.JettyFailedActionObservationSpec.a failed action answered by #handler is reported once with its own exception and route(JettyFailedActionObservationSpec.groovy:78)
expected actual
UnsupportedOperationException UnsupportedOperationException
UnsupportedOperationException
JettyFailedActionObservationSpec > a failed action answered by #handler is reported once with its own exception and route > a failed action answered by an error controller, after an asynchronous forward from an action is reported once with its own exception and route (:grails-test-examples-jetty:integrationTest in CI / Functional Tests (Java 21, indy=false, shard 1))
Condition not satisfied:

NOTIFIED[path] == [exception]
|       ||     |   |
|       ||     |   UnsupportedOperationException
|       ||     false
|       |/failing/forwardedToControllerAsynchronously
|       [UnsupportedOperationException, UnsupportedOperationException]
[/failing/forwardedToControllerAsynchronously:[UnsupportedOperationException, UnsupportedOperationException], /failing/answeredByViewAsynchronously:[IllegalStateException], /failing/forwardedToView:[IllegalStateException], /failing/answeredByControllerAsynchronously:[UnsupportedOperationException, UnsupportedOperationException], /spring/forwardedToViewAsynchronously:[IllegalStateException], /spring/forwardedToControllerAsynchronously:[UnsupportedOperationException, UnsupportedOperationException], /failing/answeredByView:[IllegalStateException], /failing/forwardedToController:[UnsupportedOperationException], /failing/answeredByController:[UnsupportedOperationException], /failing/forwardedToViewAsynchronously:[IllegalStateException], /failing/answeredByViewAfterStartingAsync:[IllegalStateException, AsyncRequestTimeoutException], /failing/answeredByControllerAfterStartingAsync:[UnsupportedOperationException, UnsupportedOperationException]]

	at issue12688.JettyFailedActionObservationSpec.a failed action answered by #handler is reported once with its own exception and route(JettyFailedActionObservationSpec.groovy:78)
expected actual
UnsupportedOperationException UnsupportedOperationException
UnsupportedOperationException
JettyFailedActionObservationSpec > a failed action answered by #handler is reported once with its own exception and route > a failed action answered by an error controller, after starting async is reported once with its own exception and route (:grails-test-examples-jetty:integrationTest in CI / Functional Tests (Java 21, indy=false, shard 1))
Condition not satisfied:

NOTIFIED[path] == [exception]
|       ||     |   |
|       ||     |   UnsupportedOperationException
|       ||     false
|       |/failing/answeredByControllerAfterStartingAsync
|       [UnsupportedOperationException, UnsupportedOperationException]
[/failing/answeredByView:[IllegalStateException], /failing/answeredByViewAsynchronously:[IllegalStateException], /failing/answeredByController:[UnsupportedOperationException], /failing/answeredByControllerAsynchronously:[UnsupportedOperationException, UnsupportedOperationException], /failing/answeredByViewAfterStartingAsync:[IllegalStateException, AsyncRequestTimeoutException], /failing/answeredByControllerAfterStartingAsync:[UnsupportedOperationException, UnsupportedOperationException]]

	at issue12688.JettyFailedActionObservationSpec.a failed action answered by #handler is reported once with its own exception and route(JettyFailedActionObservationSpec.groovy:78)
expected actual
UnsupportedOperationException UnsupportedOperationException
UnsupportedOperationException
JettyFailedActionObservationSpec > a failed action answered by #handler is reported once with its own exception and route > a failed action answered by an error controller, asynchronously is reported once with its own exception and route (:grails-test-examples-jetty:integrationTest in CI / Functional Tests (Java 21, indy=false, shard 1))
Condition not satisfied:

NOTIFIED[path] == [exception]
|       ||     |   |
|       ||     |   UnsupportedOperationException
|       ||     false
|       |/failing/answeredByControllerAsynchronously
|       [UnsupportedOperationException, UnsupportedOperationException]
[/failing/answeredByView:[IllegalStateException], /failing/answeredByViewAsynchronously:[IllegalStateException], /failing/answeredByController:[UnsupportedOperationException], /failing/answeredByControllerAsynchronously:[UnsupportedOperationException, UnsupportedOperationException]]

	at issue12688.JettyFailedActionObservationSpec.a failed action answered by #handler is reported once with its own exception and route(JettyFailedActionObservationSpec.groovy:78)
expected actual
UnsupportedOperationException UnsupportedOperationException
UnsupportedOperationException
JettyFailedActionObservationSpec > a failed action answered by #handler is reported once with its own exception and route > a failed action answered by the error view, after starting async is reported once with its own exception and route (:grails-test-examples-jetty:integrationTest in CI / Functional Tests (Java 21, indy=false, shard 1))
Condition not satisfied after 30.00 seconds and 298 attempts
	at spock.util.concurrent.PollingConditions.within(PollingConditions.java:205)
	at spock.util.concurrent.PollingConditions.eventually(PollingConditions.java:157)
	at issue12688.JettyFailedActionObservationSpec.a failed action answered by #handler is reported once with its own exception and route(JettyFailedActionObservationSpec.groovy:72)
Caused by: Condition not satisfied:

STOPPED[path] == [route, exception]
|      ||     |   |      |
|      ||     |   |      IllegalStateException
|      ||     |   /failing/answeredByViewAfterStartingAsync
|      ||     false
|      |/failing/answeredByViewAfterStartingAsync
|      [/failing/answeredByViewAfterStartingAsync, AsyncRequestTimeoutException]
[/failing/answeredByView:[/failing/answeredByView, IllegalStateException], /failing/answeredByViewAsynchronously:[/failing/answeredByViewAsynchronously, IllegalStateException], /failing/answeredByController:[/failing/answeredByController, UnsupportedOperationException], /failing/answeredByControllerAsynchronously:[/failing/answeredByControllerAsynchronously, UnsupportedOperationException], /failing/answeredByViewAfterStartingAsync:[/failing/answeredByViewAfterStartingAsync, AsyncRequestTimeoutException]]

	at issue12688.JettyFailedActionObservationSpec.a failed action answered by #handler is reported once with its own exception and route_closure1(JettyFailedActionObservationSpec.groovy:73)
	at issue12688.JettyFailedActionObservationSpec.a failed action answered by #handler is reported once with its own exception and route_closure1(JettyFailedActionObservationSpec.groovy)
	at spock.util.concurrent.PollingConditions.within(PollingConditions.java:185)
	... 2 more

Rerun Controls (first 20 of 56)

Select tests to mute in this pull request:

  • FailedActionObservationSpec > a failed action answered by #handler is reported once with its own exception and route
  • JettyFailedActionObservationSpec > a failed action answered by #handler is reported once with its own exception and route
  • UndertowFailedActionObservationSpec > a failed action answered by #handler is reported once with its own exception and route

Reuse successful test results:

  • ♻️ Only rerun the tests that failed or were muted before

Click the checkbox to trigger a rerun:

  • Rerun jobs

Learn more about TestLens at testlens.app/docs.

@sbglasius sbglasius 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.

This is an AI assisted review

Re-approving at 5065b39. c960808 and d083eda cover points 1 and 2, and the reason for keeping 3 as it is makes sense. The async FailedActionObservationSpec failures also happen on 9.0.x, so they don't come from this PR.

@matrei matrei 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.

Reviewed again at 5065b39 (base 9.0.x, merge base c4d4c59). 9.0.x has moved on to fdde94a since, which touches none of the files of this PR.

Both points of my first review are fixed:

  1. e17f652 and 5065b39: What's New and the content negotiation section link the upgrade notes by the upgradingSpringFormatNegotiation anchor, and What's New links the guide section with <<springFormatNegotiation,...>>. In the built guide, every link to the two sections stays on the page in single.html, and on the chapter pages they point at theWebLayer.html#springFormatNegotiation and upgrading.html#upgradingSpringFormatNegotiation. I missed in my first review that the other numbers in that sentence were stale too, since 9.0.x added sections 2 and 3. 6 to 13 and 15 to 18 are the right ones.
  2. c903885: the spec requests /springWritten/text.text with Accept: application/json and expects text/plain.

What I ran at 5065b39, with the build cache off:

  • The unit tests of the modules this touches: grails-mimetypes (202), grails-web-url-mappings (533), grails-url-mappings (22), grails-test-suite-web (3442), grails-spring-security (327) and grails-rest-transforms (176). All pass.
  • :grails-test-examples-spring-format-negotiation:integrationTest (12) and app1's functionaltests.contentneg.* (26). All pass.
  • With GRAILS_MIME_NEGOTIATION_SPRING=true: app1's full integration suite (728), views-functional-tests (60) and the spring-security core integration-test-app (65). As before, only the three features of app1's GrailsFormatNegotiationSpec that pin the default rules fail. So the setting still turns the marker on when it comes from the environment, now that the URL mappings plugin reads it as well.
  • :grails-doc:publishGuide builds.

The Functional Tests and SiteMesh 2 jobs fail with the same tests in 9.0.x's own run at fdde94a. The Hibernate7 job fails only on five DB2 rows, from the DB2 container, and the canary jobs fail on 9.0.x too.

Optional

  1. a7ae6fc: the guide, the upgrade notes, the skill and the Javadoc of springMediaTypesOf say the fallback takes a format that spring.mvc.contentnegotiation.media-types maps. It takes any format Spring MVC's manager maps, and the manager also holds the defaults WebMvcConfigurationSupport registers for the converters present: json, and xml, atom, rss, smile, cbor and yaml where their libraries are on the classpath. The lookup also ignores case, while a format of grails.mime.types has to match exactly. So with no media-types configured, ?format=JSON is written as application/json through Spring MVC's json default, while respond answers it with 406. I checked both with temporary features in SpringFormatNegotiationSpec and SpringFormatNegotiationParameterRespondSpec. Spring MVC's parameter strategy does the same with favor-parameter, so I think the behaviour is fine. Only the wording undersells it: "a format Spring MVC's content negotiation manager maps, such as one spring.mvc.contentnegotiation.media-types adds" would cover it.

Verified as correct

  • c960808: without the setting, the handler mapping neither sets BEST_MATCHING_HANDLER_ATTRIBUTE nor adds the interceptor that removes it, and a web unit test does not set it, so the handler chain and the request attributes are those of 9.0.x. UrlMappingsBeanDefinitionsPostProcessor is the only place that registers the handler mapping, so no other path builds one without the flag. The URL mappings plugin, MimeTypesConfiguration and GrailsWebUnitTest all read the setting from grailsApplication.config.
  • d083eda: the kept strategy is the application's own, or one built from the same settings, so a forward, include or asynchronous dispatch that finds it on the request gets the answer a fresh lookup would give.
  • a7ae6fc: mediaTypesOf returns null rather than an empty list, so the ?: falls back only for a format grails.mime.types has no type for, and a format Grails configures keeps its own types. The manager holds its mappings with favor-parameter off too, which the new spec rows cover.

@codeconsole
codeconsole merged commit 733397b into apache:9.0.x Nov 20, 2026
92 of 103 checks passed
@codeconsole

Copy link
Copy Markdown
Contributor Author

@matrei thanks for the second review. The optional point (the fallback takes any format Spring MVC's manager maps, including its converter defaults, whatever the case) is fixed in #17102, with a spec feature that pins the json default as json and JSON.

codeconsole added a commit to codeconsole/grails-core that referenced this pull request Nov 22, 2026
preferringSuffixedXml took each +xml type behind the XML type out of the
list with remove(Object), which removes the first equal type. Where the
header lists a type twice, that was the one ahead of the XML type, so the
first pass, which decides what Spring MVC writes, left the type behind it,
and the second, when Grails resolves its formats, moved it again: with the
default grails.mime.types, Accept: application/atom+xml, application/xml,
application/atom+xml had Spring MVC write application/xml while the format
was atom, and application/xml, application/atom+xml, application/atom+xml
was the xml format. With problem+xml mapped in Spring MVC only, the same
happened with an unconfigured problem+xml as the XML type. apache#16996 brought
the method in on 9.0.x.

Each type is now removed from its own index. After one pass no +xml type
of the quality of the XML type is left behind it, so a second pass changes
nothing, and the format and the type Spring MVC writes agree.
SpringFormatNegotiationSpec covers the repeated type with the default
types and with the Spring-only problem mapping, and
FormatNegotiationComparisonSpec sends application/atom+xml,
application/xml, application/atom+xml under every configuration, where
only what Spring MVC writes differs.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

5 participants