Savonitar opened a new pull request, #134:
URL: https://github.com/apache/flink-connector-pulsar/pull/134
## Purpose of the change
Pulsar sink tests create `ProducerRegister` and `PulsarWriter` instances
without closing them, leaving their clients and producers open after the tests
finish. Use try-with-resources to close these resources on success and failure.
## Brief change log
- Close all test-created registers in `ProducerRegisterTest`.
- Close the writer in `PulsarWriterTest.writeMessageAndVerify`, which also
closes its register and metadata listener.
- Preserve the existing sends, transaction logic, and assertions.
## Verifying this change
The existing tests passed against Pulsar 4.0.14:
- `ProducerRegisterTest`: 7 tests passed.
- `PulsarWriterTest`: 4 tests passed.
**11 tests passed, with 0 failures, 0 errors, and 0 skipped tests.**
Checkstyle reported 0 violations.
```sh
mvn -B -pl flink-connector-pulsar -am \
-Dtest=ProducerRegisterTest,PulsarWriterTest \
-Dsurefire.failIfNoSpecifiedTests=false test
```
## Significant changes
- [ ] Dependencies have been added or upgraded
- [ ] Public API has been changed
- [ ] Serializers have been changed
- [ ] New feature has been introduced
---
##### Was generative AI tooling used to co-author this PR?
- [x] Yes
Generated-by: OpenAI Codex (GPT-6)
--
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]