Skip to content

[improve][test] Add Aerospike sink integration test#96

Merged
david-streamlio merged 1 commit into
apache:masterfrom
david-streamlio:test/aerospike-integration
Jul 10, 2026
Merged

[improve][test] Add Aerospike sink integration test#96
david-streamlio merged 1 commit into
apache:masterfrom
david-streamlio:test/aerospike-integration

Conversation

@david-streamlio

@david-streamlio david-streamlio commented Jul 10, 2026

Copy link
Copy Markdown
Contributor

No description provided.

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.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 AerospikeStringSink and verifies round-trip reads via an independent AerospikeClient.
  • 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.

@david-streamlio

Copy link
Copy Markdown
Contributor Author

The one-line production change here — Value.getAsBlob(...)Value.get(...) — fixes a real, severe defect filed as #97: with the pinned aerospike-client-bc:4.5.0, the blob serializer is compiled out, so estimateSize() throws "Object serializer has been disabled" on every write. The sink was completely non-functional. Verified from the client bytecode. Since the old path never succeeded, no existing data depends on the blob format, so switching to a native bin is safe. Flagging per the #78/#79 precedent in case maintainers prefer this fix as its own PR with the test rebased on top.

@david-streamlio david-streamlio merged commit 090907a into apache:master Jul 10, 2026
4 checks passed
@david-streamlio david-streamlio deleted the test/aerospike-integration branch July 10, 2026 19:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants