goutamadwant opened a new pull request, #12471: URL: https://github.com/apache/seatunnel/pull/12471
### Purpose of this pull request `GoogleAnalytics4SourceReaderTest.oversizedBodyIsNotRetriedAndDoesNotComplete` fails intermittently in unrelated PR builds with `Mock HTTP contract failed`. The reader is fine in these runs; the failure comes from the mock server. The test serves a 200 response with `Content-Length: 2048` while `max_response_bytes` is 1024. `GoogleAnalytics4HttpTransport.post` rejects that from the header alone and aborts the request, as designed. The mock handler still writes the 2048-byte body after sending the headers, so that write races with: - the client abort, which gives `Broken pipe` or, on Windows, `An existing connection was forcibly closed by the remote host`; and - `server.stop(0)` in `@AfterEach`, which closes the exchange stream and gives `stream is closed`. Whichever loses, the handler records the `IOException` in `serverFailure`, and teardown turns it into `Mock HTTP contract failed`. Recent failures on unrelated PRs: - #12333, `unit-test (8, windows-latest)`: `Caused by: java.io.IOException: An existing connection was forcibly closed by the remote host` at `reply(...)`, called from the `oversizedBodyIsNotRetriedAndDoesNotComplete` handler. https://github.com/wgzhao/seatunnel/actions/runs/35861652502/job/107187046794 - #11545, `unit-test (17, ubuntu-latest)`: `Caused by: java.io.IOException: stream is closed` at the same line. https://github.com/DanielLeens/seatunnel/actions/runs/35943527433/job/107457085961 The change is test-only. The handler for this one test now sends the headers itself and ignores an `IOException` from the body write, because at that point the reader is expected to have hung up. Every assertion on the reader is unchanged: the size-limit error, exactly one request (no retry), and no `signalNoMoreElement`. Other tests still record server-side failures as before. ### Does this PR introduce _any_ user-facing change? No. Test-only change. ### How was this patch tested? **Before (unchanged `dev`, `deb16a3c3`).** I ran the single method repeatedly in one JVM through the JUnit Platform launcher on macOS, with 20 busy-loop processes competing for CPU: | JDK | Iterations | Failures | Cause | |---|--:|--:|---| | 8u172 | 600 (2 × 300) | 4 | `IOException: Broken pipe` | | 11.0.19 | 300 | 2 | `IOException: Broken pipe` | **Forced window.** A local-only hook, not part of this PR, made the handler pause 200 ms between the headers and the body, and made teardown wait 500 ms before checking `serverFailure`, so a late handler failure is observed. Results: | Code | JDK 8 | JDK 11 | |---|--:|--:| | Unchanged `dev` | 20/20 failed (`stream is closed`) | 20/20 failed (`stream is closed`) | | This patch, same hook | 0/20 failed | 0/20 failed | **After (this patch).** Same contention setup, no hook: 0/300 failures on JDK 8 and 0/300 on JDK 11. **Module build.** `./mvnw -B -o -pl seatunnel-connectors-v2/connector-google-analytics4 clean verify -DskipUT=false -DskipIT=true` passed on JDK 8 and JDK 11: 23 tests, 0 failures, and spotless check passed. **Not verified locally:** Windows. The Windows signature (connection reset by the client abort) is the same race as the one reproduced above. ### Check list * [ ] If any new Jar binary package adding in your PR, please add License Notice according [New License Guide](https://github.com/apache/seatunnel/blob/dev/docs/en/developer/new-license.md) * [ ] If necessary, please update the documentation to describe the new feature. https://github.com/apache/seatunnel/tree/dev/docs * [ ] If necessary, please update `incompatible-changes.md` to describe the incompatibility caused by this PR. * [ ] If you are contributing the connector code, please check that the following files are updated: 1. Update [plugin-mapping.properties](https://github.com/apache/seatunnel/blob/dev/plugin-mapping.properties) and add new connector information in it 2. Update the pom file of [seatunnel-dist](https://github.com/apache/seatunnel/blob/dev/seatunnel-dist/pom.xml) 3. Add ci label in [label-scope-conf](https://github.com/apache/seatunnel/blob/dev/.github/workflows/labeler/label-scope-conf.yml) 4. Add e2e testcase in [seatunnel-e2e](https://github.com/apache/seatunnel/tree/dev/seatunnel-e2e/seatunnel-connector-v2-e2e/) 5. Update connector [plugin_config](https://github.com/apache/seatunnel/blob/dev/config/plugin_config) -- 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]
