This is an automated email from the ASF dual-hosted git repository.

github-merge-queue[bot] pushed a commit to branch 
gh-readonly-queue/dev/pr-12444-62ae6a3a10d70a5f971bb5d9df0e443482463667
in repository https://gitbox.apache.org/repos/asf/seatunnel.git

commit 426e44f96ca09618286280176dd7ef931511d6e6
Author: Daniel <[email protected]>
AuthorDate: Mon Sep 28 11:36:16 2026 +0000

    [Test][Connector-V2] Release PayPalClientTest's arrival latch before the 
response body write (#12444)
    
    Co-authored-by: DanielLeens <[email protected]>
    Co-authored-by: Claude Fable 5.1 <[email protected]>
---
 .../connectors/seatunnel/paypal/source/PayPalClientTest.java     | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

diff --git 
a/seatunnel-connectors-v2/connector-http/connector-http-paypal/src/test/java/org/apache/seatunnel/connectors/seatunnel/paypal/source/PayPalClientTest.java
 
b/seatunnel-connectors-v2/connector-http/connector-http-paypal/src/test/java/org/apache/seatunnel/connectors/seatunnel/paypal/source/PayPalClientTest.java
index 0a59c9e486..fac9d75630 100644
--- 
a/seatunnel-connectors-v2/connector-http/connector-http-paypal/src/test/java/org/apache/seatunnel/connectors/seatunnel/paypal/source/PayPalClientTest.java
+++ 
b/seatunnel-connectors-v2/connector-http/connector-http-paypal/src/test/java/org/apache/seatunnel/connectors/seatunnel/paypal/source/PayPalClientTest.java
@@ -183,14 +183,21 @@ class PayPalClientTest {
                 arrived.countDown();
                 release.await(5, TimeUnit.SECONDS);
             } else {
-                exchange.getResponseBody().write(reply.body);
+                // Release the latch before the body write. PayPalClient does 
not read the body
+                // of a transient status (it returns as soon as it has the 
status line and then
+                // aborts the request), so on Windows the peer close can turn 
this write into an
+                // IOException, and the countDown that used to follow it was 
skipped.
                 arrived.countDown();
+                exchange.getResponseBody().write(reply.body);
             }
         } catch (InterruptedException e) {
             Thread.currentThread().interrupt();
         } catch (IOException ignored) {
             /* Cancellation intentionally closes the peer socket. */
         } finally {
+            // The request reached the server whichever branch failed above, 
so a test must
+            // never keep waiting on the latch only because the response could 
not be written.
+            arrived.countDown();
             exchange.close();
         }
     }

Reply via email to