gnodet opened a new pull request, #2219:
URL: https://github.com/apache/maven-resolver/pull/2219
## Summary
Fixes a regression introduced by #2206: `testPut_StartCancelled` fails on
macOS CI with "Expected error" because `TransferCancelledException` from the
retroactive `transportStarted()` call is silently swallowed.
## Root Cause
#2206 added a retroactive progress-event block that fires
`transportStarted`/`transportProgressed` after a successful response, for
macOS/Jetty configurations that skip `onRequestContent` callbacks. The block
caught `TransferCancelledException` from `transportStarted()` and fell through
silently:
```java
} catch (TransferCancelledException e) {
// upload already sent — retroactive notification cannot be cancelled;
// fall through to transportPropertiesAvailable and status check
}
```
When a test listener has `cancelStart()` set, `transportStarted()` is
supposed to throw and the caller (`transporter.put()`) must surface that
exception. The catch-and-ignore broke this contract, causing the PUT to
complete without error instead of throwing `TransferCancelledException`.
## Fix
Remove the try/catch around the retroactive `transportStarted()` call. The
exception propagates naturally — the fact that bytes were already sent does not
authorise silencing a `cancelStart` cancellation.
The `catch (TransferCancelledException e) { break; }` inside the retroactive
`transportProgressed` loop is kept as-is: it exits the loop (correct) and the
status check still runs after.
## Testing
- `testPut_StartCancelled` now passes (was failing)
- `testPut_ProgressCancelled`, `testPut_ProxyAuthenticated`, `testPut_SSL`
continue to pass
- Full `JettyTransporterTest` suite: 90 tests pass, 10 skipped (HTTP/3
infra), 0 failures
_Hermes Agent (Claude Sonnet 4.6) on behalf of Guillaume Nodet_
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]