From b1536598d196a95bba8913755c2c754a33e23428 Mon Sep 17 00:00:00 2001 From: Julian Nguyen <109386615+juliannguyen4@users.noreply.github.com> Date: Fri, 31 Jul 2026 11:05:27 -0700 Subject: [PATCH 1/5] Add test job that inserts AS_BYTES_PYTHON using Python client < 13.0.0 and tests the Python client returns that value as a bytearray. TODO - locally I currently see that a bytes instance is returned instead which causes the test to fail --- .github/workflows/smoke-tests.yml | 21 +++++++++++++------ test/standalone/insert_as_bytes_python.py | 15 +++++++++++++ .../test_deserialize_as_bytes_python.py | 15 +++++++++++++ 3 files changed, 45 insertions(+), 6 deletions(-) create mode 100644 test/standalone/insert_as_bytes_python.py create mode 100644 test/standalone/test_deserialize_as_bytes_python.py diff --git a/.github/workflows/smoke-tests.yml b/.github/workflows/smoke-tests.yml index 2d2481d6f9..6ca04eea54 100644 --- a/.github/workflows/smoke-tests.yml +++ b/.github/workflows/smoke-tests.yml @@ -386,7 +386,7 @@ jobs: working-directory: test/standalone # This is an e2e test to check that the user agent was sent correctly to the server - test-user-agent: + test-standalone: needs: [ build, get-env-vars @@ -395,9 +395,10 @@ jobs: fail-fast: false matrix: test-script-args: - - "false" - - "true" - - "true my_app_id" + - "./test-user-agent-e2e.bash false" + - "./test-user-agent-e2e.bash true" + - "./test-user-agent-e2e.bash true my_app_id" + - "python3 ./test_deserialize_as_bytes_python.py" runs-on: ${{ needs.build.outputs.runner-os-used-for-build }} steps: - name: Harden the runner (Audit all outbound calls) @@ -413,7 +414,6 @@ jobs: - uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1 with: pattern: ${{ vars.GH_ARTIFACT_NAME_PREFIX_FOR_BUILDS }}-${{ env.LOWEST_SUPPORTED_PY_VERSION }}-${{ env.PLATFORM_TAG }} - - run: python3 -m pip install ./*.whl - id: setup-aerospike-server uses: aerospike/shared-workflows/.github/actions/setup-aerospike-server@bd168dedaa4fc0b17a560541779d815540eded2d # v3.7.0 @@ -426,9 +426,18 @@ jobs: server-tag: ${{ needs.get-env-vars.outputs.server-tag }} server-container-repo: database-docker-virtual/aerospike-server${{ startsWith(matrix.test-script-args, 'true') && '-enterprise' || '' }} + - if: ${{ contains(matrix.test-script-args, 'deserialize_as_bytes_python') }} + name: Install Python client that supports inserting AS_BYTES_PYTHON + run: | + python3 -m pip install aerospike==12.* + python3 ./insert_as_bytes_python.py + working-directory: test/standalone + + - run: python3 -m pip install ./*.whl + # Even for server versions < 8.1 that don't support user agent, this client version should still work on older servers - name: Run client in background - run: ./test-user-agent-e2e.bash ${{ matrix.test-script-args }} + run: ${{ matrix.test-script-args }} working-directory: test/standalone - if: ${{ !cancelled() }} diff --git a/test/standalone/insert_as_bytes_python.py b/test/standalone/insert_as_bytes_python.py new file mode 100644 index 0000000000..979b80ce83 --- /dev/null +++ b/test/standalone/insert_as_bytes_python.py @@ -0,0 +1,15 @@ +import aerospike + +config = { + "hosts": [ + ("127.0.0.1", 3000) + ], + "send_bool_as": aerospike.PY_BYTES +} +client = aerospike.client(config) + +bins = {"a": True} +key = ("test", "demo", 1) +client.put(key, bins=bins) + +client.close() diff --git a/test/standalone/test_deserialize_as_bytes_python.py b/test/standalone/test_deserialize_as_bytes_python.py new file mode 100644 index 0000000000..2053b9637f --- /dev/null +++ b/test/standalone/test_deserialize_as_bytes_python.py @@ -0,0 +1,15 @@ +import aerospike + +config = { + "hosts": [ + ("127.0.0.1", 3000) + ], +} +client = aerospike.client(config) + +key = ("test", "demo", 1) +_, _, bins = client.get(key) +print(bins["a"]) +assert isinstance(bins["a"], bytearray) + +client.close() From 4ac5524ddcf6003e78d938c399724368b167eb6d Mon Sep 17 00:00:00 2001 From: Julian Nguyen <109386615+juliannguyen4@users.noreply.github.com> Date: Fri, 31 Jul 2026 11:55:52 -0700 Subject: [PATCH 2/5] Run valgrind in CI/CD to see if the leak comes up --- .github/workflows/smoke-tests.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/smoke-tests.yml b/.github/workflows/smoke-tests.yml index 6ca04eea54..e5d6e0e2ac 100644 --- a/.github/workflows/smoke-tests.yml +++ b/.github/workflows/smoke-tests.yml @@ -398,7 +398,7 @@ jobs: - "./test-user-agent-e2e.bash false" - "./test-user-agent-e2e.bash true" - "./test-user-agent-e2e.bash true my_app_id" - - "python3 ./test_deserialize_as_bytes_python.py" + - "PYTHONMALLOC=malloc valgrind --leak-check=full --show-leak-kinds=definite --error-for-leak-kinds=definite python3 ./test_deserialize_as_bytes_python.py" runs-on: ${{ needs.build.outputs.runner-os-used-for-build }} steps: - name: Harden the runner (Audit all outbound calls) From ea98ec8911133be69576825dc51f2e95ce7a208b Mon Sep 17 00:00:00 2001 From: Julian Nguyen <109386615+juliannguyen4@users.noreply.github.com> Date: Fri, 31 Jul 2026 12:06:35 -0700 Subject: [PATCH 3/5] Revert "Run valgrind in CI/CD to see if the leak comes up" This reverts commit 4ac5524ddcf6003e78d938c399724368b167eb6d. --- .github/workflows/smoke-tests.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/smoke-tests.yml b/.github/workflows/smoke-tests.yml index e5d6e0e2ac..6ca04eea54 100644 --- a/.github/workflows/smoke-tests.yml +++ b/.github/workflows/smoke-tests.yml @@ -398,7 +398,7 @@ jobs: - "./test-user-agent-e2e.bash false" - "./test-user-agent-e2e.bash true" - "./test-user-agent-e2e.bash true my_app_id" - - "PYTHONMALLOC=malloc valgrind --leak-check=full --show-leak-kinds=definite --error-for-leak-kinds=definite python3 ./test_deserialize_as_bytes_python.py" + - "python3 ./test_deserialize_as_bytes_python.py" runs-on: ${{ needs.build.outputs.runner-os-used-for-build }} steps: - name: Harden the runner (Audit all outbound calls) From 32b042829385806942a9f3769a5c06d36993af35 Mon Sep 17 00:00:00 2001 From: Julian Nguyen <109386615+juliannguyen4@users.noreply.github.com> Date: Fri, 31 Jul 2026 12:13:32 -0700 Subject: [PATCH 4/5] Address regression with CI/CD --- .github/workflows/smoke-tests.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/smoke-tests.yml b/.github/workflows/smoke-tests.yml index 6ca04eea54..43c34beaf3 100644 --- a/.github/workflows/smoke-tests.yml +++ b/.github/workflows/smoke-tests.yml @@ -418,13 +418,13 @@ jobs: - id: setup-aerospike-server uses: aerospike/shared-workflows/.github/actions/setup-aerospike-server@bd168dedaa4fc0b17a560541779d815540eded2d # v3.7.0 with: - enable-security: ${{ startsWith(matrix.test-script-args, 'true') }} + enable-security: ${{ startsWith(matrix.test-script-args, './test-user-agent-e2e.bash true') }} num-nodes: 1 oidc-provider: ${{ vars.OIDC_PROVIDER_NAME }} oidc-audience: ${{ vars.OIDC_AUDIENCE }} features-content: ${{ secrets.FEATURES_CONTENT }} server-tag: ${{ needs.get-env-vars.outputs.server-tag }} - server-container-repo: database-docker-virtual/aerospike-server${{ startsWith(matrix.test-script-args, 'true') && '-enterprise' || '' }} + server-container-repo: database-docker-virtual/aerospike-server${{ startsWith(matrix.test-script-args, './test-user-agent-e2e.bash true') && '-enterprise' || '' }} - if: ${{ contains(matrix.test-script-args, 'deserialize_as_bytes_python') }} name: Install Python client that supports inserting AS_BYTES_PYTHON From 352804928716c84f08cc4f722487f4688595907a Mon Sep 17 00:00:00 2001 From: Julian Nguyen <109386615+juliannguyen4@users.noreply.github.com> Date: Fri, 31 Jul 2026 12:18:32 -0700 Subject: [PATCH 5/5] Cherrypick fix from 2f57ae5 thanks to @AKASHHMISHRA1. I expect the test failure to be resolved --- src/main/serializer.c | 1 + 1 file changed, 1 insertion(+) diff --git a/src/main/serializer.c b/src/main/serializer.c index ec74fe04aa..7748fe140d 100644 --- a/src/main/serializer.c +++ b/src/main/serializer.c @@ -429,6 +429,7 @@ extern as_status deserialize_based_on_as_bytes_type(AerospikeClient *self, } *retval = py_val; as_error_update(error_p, AEROSPIKE_OK, NULL); + break; case AS_BYTES_BLOB: { if (self->user_deserializer_call_info.callback) { execute_user_callback(&self->user_deserializer_call_info, &bytes,