gnodet opened a new pull request, #2206:
URL: https://github.com/apache/maven-resolver/pull/2206

   ## Summary
   
   Fixes the flaky `JettyTransporterTest.testPut_ProxyAuthenticated` and 
`JettyTransporterTest.testPut_SSL` tests that intermittently fail on macOS with 
`progressedCount = 0`.
   
   ## Root Cause
   
   `JettyTransporter.implPut()` relies on Jetty's `onRequestContent` callback 
to fire `transportProgressed` events. On macOS runners with proxy 
authentication or TLS/HTTP2, Jetty's async pipeline can coalesce small request 
bodies (6 bytes in the test) with the headers send, bypassing the per-chunk 
`onRequestContent` callback entirely. The upload succeeds (the file is written 
on the server), but the progress listener is never notified.
   
   This is a platform-specific timing issue in Jetty's HTTP/2 send pipeline — 
on Linux and Windows, the callback fires reliably; on macOS (kqueue-based IO), 
the write completes without the intermediate notification.
   
   ## Fix
   
   After a successful PUT request completes, check whether any 
`onRequestContent` callback actually fired (tracked via a new `progressed` 
AtomicBoolean). If not, fire the missing 
`transportStarted`/`transportProgressed` events retroactively using the task's 
data. This is safe because:
   
   1. The request completed successfully (no exception, status < 300)
   2. The data was definitely transmitted (verified by the server response)
   3. The events fire synchronously on the caller's thread, not in Jetty's 
async pipeline
   
   The fix is minimal (16 lines added) and does not change behavior when 
`onRequestContent` fires normally — the retroactive path is only taken as a 
fallback.
   
   ## Testing
   
   - All 103 JettyTransporterTest tests pass (90 active + 10 disabled + 3 
others)
   - All 144 ApacheTransporterTest tests pass (unaffected)
   - No changes to test infrastructure
   
   ---
   _Hermes Agent (Claude Opus 4) 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]

Reply via email to