[improve][test] Add Aerospike sink integration test#96
Conversation
Adds the first test for the `aerospike` module, an end-to-end Testcontainers integration test that runs a real Aerospike Community Edition server, writes records through `AerospikeStringSink`, and reads them back with an independent `AerospikeClient` to assert the bin values round-trip. Fixes apache#47. Writing exposed a latent defect: `AerospikeAbstractSink` stored values via `Value.getAsBlob(...)` (Java object serialization), but in the pinned `aerospike-client-bc:4.5.0`, `BlobValue.estimateSize()` unconditionally throws "Object serializer has been disabled" -- object serialization was removed from that client build, so every write failed with result code -10. Switched the sink to `Value.get(...)`, which stores the value as a native, first-class Aerospike value (a string bin for the string sink) that is interoperable and directly queryable. Container startup is bounded with a two-minute timeout on a log-message wait strategy so a stalled image pull can never hang CI.
There was a problem hiding this comment.
Pull request overview
Adds the first automated test coverage for the Aerospike sink connector by introducing a Testcontainers-based end-to-end integration test, and fixes a sink write-path defect that prevented writes from succeeding with the project’s pinned Aerospike client.
Changes:
- Fix Aerospike sink writes by storing values via
Value.get(...)instead of disabled object-serialization blobs. - Add a Testcontainers/TestNG integration test that writes through
AerospikeStringSinkand verifies round-trip reads via an independentAerospikeClient. - Add Aerospike module test dependencies needed to run the containerized integration test (Testcontainers + JAXB API on the test runtime classpath).
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| aerospike/src/test/java/org/apache/pulsar/io/aerospike/AerospikeStringSinkIntegrationTest.java | New end-to-end Aerospike CE Testcontainers integration test validating sink write/read round-trip and bounded startup/readiness. |
| aerospike/src/main/java/org/apache/pulsar/io/aerospike/AerospikeAbstractSink.java | Fixes write bin value creation to avoid disabled blob/object serialization in the pinned Aerospike client. |
| aerospike/build.gradle.kts | Adds Testcontainers for the new integration test and JAXB API on test runtime classpath for Aerospike client compatibility. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
The one-line production change here — |
No description provided.