Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
87 commits
Select commit Hold shift + click to select a range
a4e206e
Fix test_append neg tests
juliannguyen4 Apr 21, 2023
e0ee1df
Changed tests in test_remove_bin.py
DomPeliniAerospike Nov 20, 2023
c931bc0
Revert test_remove_bin to original behavior
juliannguyen4 Nov 20, 2023
6a3ac8c
Fix prepend test
juliannguyen4 Nov 20, 2023
b319732
Fix more admin tests
juliannguyen4 Nov 20, 2023
8e16813
Fix more admin tests
juliannguyen4 Nov 20, 2023
fd60e4a
Finish fixing admin tests and more API tests
juliannguyen4 Nov 21, 2023
0bf7902
Fix a few get put tests
juliannguyen4 Nov 21, 2023
ac3b1cf
Fix more
juliannguyen4 Nov 27, 2023
25a795a
finish cleaning
juliannguyen4 Nov 30, 2023
66f9a03
Exists shouldnt throw an error if record not found
juliannguyen4 Nov 30, 2023
030c475
revert max_error_rate test
juliannguyen4 Nov 30, 2023
e0592df
Fix some tests
juliannguyen4 Nov 30, 2023
b59817b
Fix bug
juliannguyen4 Nov 30, 2023
632a051
Fix test
juliannguyen4 Nov 30, 2023
4bca4ac
fix
juliannguyen4 Dec 2, 2023
3438330
Revert tests that were failing but could not fix
juliannguyen4 Dec 8, 2023
baf9218
Revert "Fix bug"
juliannguyen4 Dec 8, 2023
adb74c1
Merge remote-tracking branch 'origin/dev' into CLIENT-2305-false-pos-…
juliannguyen4 Sep 27, 2024
baafb85
Merge remote-tracking branch 'origin/dev' into CLIENT-2305-false-pos-…
juliannguyen4 Sep 19, 2025
6224dd5
fix max_error_rate tests. check if tests are correct or not
juliannguyen4 Sep 19, 2025
4e078e2
Merge remote-tracking branch 'origin/dev' into CLIENT-2305-false-pos-…
juliannguyen4 Feb 3, 2026
49d347d
Merge remote-tracking branch 'origin/dev' into CLIENT-2305-false-pos-…
juliannguyen4 Feb 9, 2026
f83fcc0
Remove deprecated tests
juliannguyen4 Feb 9, 2026
666311e
Just increase timeout to be safe
juliannguyen4 Feb 10, 2026
9abb456
Review part
juliannguyen4 Feb 10, 2026
66fbb00
Revert test. Not sure why I did this a few years ago
juliannguyen4 Feb 10, 2026
0a9a434
clean this up...
juliannguyen4 Feb 10, 2026
7258703
fix
juliannguyen4 Feb 11, 2026
8387208
Revert because test_max_error_rate.py isn't testing the option right
juliannguyen4 Feb 11, 2026
9efab8a
forgot to change
juliannguyen4 Feb 12, 2026
5df2464
fix test
juliannguyen4 Feb 12, 2026
0375e7b
fix more...
juliannguyen4 Feb 12, 2026
c4e8dc9
fix
juliannguyen4 Feb 13, 2026
00857a6
Just set context manager for now. not sure why this test didn't raise…
juliannguyen4 Feb 13, 2026
c849732
Fix more IndexFound exceptions not being tested
juliannguyen4 Feb 13, 2026
bd0660a
Revert "Fix more IndexFound exceptions not being tested"
juliannguyen4 Feb 13, 2026
ce1479d
Revert "Just set context manager for now. not sure why this test didn…
juliannguyen4 Feb 13, 2026
f698db0
Also try testing indexnotfound exception.
juliannguyen4 Feb 13, 2026
704b51e
Revert "Also try testing indexnotfound exception."
juliannguyen4 Feb 13, 2026
8f2615d
Address last test case.
juliannguyen4 Feb 13, 2026
a5c3038
Merge remote-tracking branch 'origin/dev' into CLIENT-2305-false-pos-…
juliannguyen4 Feb 18, 2026
13b9533
Merge remote-tracking branch 'origin/dev' into CLIENT-2305-false-pos-…
juliannguyen4 Feb 18, 2026
036fdbf
Run test with procdump on self hosted runner
juliannguyen4 Feb 19, 2026
8f7f9ff
fix
juliannguyen4 Feb 19, 2026
f946089
fix...
juliannguyen4 Feb 19, 2026
296303c
fix
juliannguyen4 Feb 19, 2026
12a54b5
Compile Python client with debug configuration
juliannguyen4 Feb 19, 2026
16c4726
A different static library is used for pthreadVC2 with debug config
juliannguyen4 Feb 19, 2026
01419ab
fix
juliannguyen4 Feb 19, 2026
7c83b9c
Include symbols with repaired wheel
juliannguyen4 Feb 19, 2026
15c4acb
pdb files do not get mangled in wheel along with the mangled DLL files.
juliannguyen4 Feb 20, 2026
ddd3328
Allow compiling Python client C code with debug information bundled w…
juliannguyen4 Feb 20, 2026
c0505e8
upload .dmp file to github as an artifact. it can be analyzed anywhere
juliannguyen4 Feb 20, 2026
dc98f26
fix...
juliannguyen4 Feb 20, 2026
d1ebbde
not sure what error code is returned from procdump
juliannguyen4 Feb 20, 2026
2906e5b
Merge remote-tracking branch 'origin/dev' into CLIENT-4237-debug-wind…
juliannguyen4 Feb 20, 2026
eebff91
prevent jobs overriding each other's dump files
juliannguyen4 Feb 20, 2026
a861985
Run with debug logging
juliannguyen4 Feb 20, 2026
ff2d7fa
Clean up setup.py
juliannguyen4 Feb 23, 2026
b3eb8d4
Clean up
juliannguyen4 Feb 23, 2026
d46be41
Run with procdump by default since there's little overhead (TODO need…
juliannguyen4 Feb 23, 2026
7fca5de
Try running Dr Memory in CI/CD. TODO need to generate suppressions file
juliannguyen4 Feb 23, 2026
5bf8e28
Fix
juliannguyen4 Feb 23, 2026
a014bf3
Fix
juliannguyen4 Feb 23, 2026
3105d0e
Fix workflow
juliannguyen4 Feb 23, 2026
41fbe58
This syntax probably only works for bash
juliannguyen4 Feb 23, 2026
f77348c
using a glob pattern for data_files causes an error. just exclude bc …
juliannguyen4 Feb 23, 2026
faf226a
Try running drmemory without -light flag
juliannguyen4 Feb 23, 2026
ceb737f
Revert to running with procdump
juliannguyen4 Feb 23, 2026
a44159a
fix. procdump no longer in cwd
juliannguyen4 Feb 23, 2026
87e8288
Fix workflow
juliannguyen4 Feb 23, 2026
a84d479
Test Brian's fix for the Windows seg fault
juliannguyen4 Feb 23, 2026
9b981ea
Specify path to find pdb files
juliannguyen4 Feb 23, 2026
60f0f68
Increase stack trace size to 100 frames
juliannguyen4 Feb 24, 2026
e7164b0
Force CPython to use malloc for all memory allocations
juliannguyen4 Feb 24, 2026
73a5ef8
Increase stack frame limit to 200 since some stack traces are over 10…
juliannguyen4 Feb 24, 2026
48be865
\ only works for windows
juliannguyen4 Feb 24, 2026
26404d0
API docs says comma separated.
juliannguyen4 Feb 24, 2026
2702124
fix...
juliannguyen4 Feb 24, 2026
5fea96f
200 is too slow
juliannguyen4 Feb 24, 2026
e4848a1
Replace allowlist with suppressions file. Should be faster
juliannguyen4 Feb 24, 2026
7f4a34b
Keep forgetting wget doesn't exist on windows
juliannguyen4 Feb 24, 2026
03f4b58
Cherrypick cicd changes from CLIENT-4237-debug-windows-crash-during-a…
juliannguyen4 Feb 24, 2026
f84bbe1
Get baseline from dev branch
juliannguyen4 Feb 24, 2026
00ca4dc
Disable leak checking to make drmemory run faster
juliannguyen4 Feb 24, 2026
23532bb
Merge branch 'CLIENT-4237-run-drmemory-on-windows-from-dev' into CLIE…
juliannguyen4 Feb 24, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
33 changes: 30 additions & 3 deletions .github/workflows/build-wheels.yml
Original file line number Diff line number Diff line change
Expand Up @@ -248,8 +248,9 @@ jobs:
shell: bash

- name: Set unoptimize flag
if: ${{ inputs.unoptimized && (startsWith(inputs.platform-tag, 'manylinux') || startsWith(inputs.platform-tag, 'macosx')) }}
if: ${{ inputs.unoptimized }}
run: echo "UNOPTIMIZED=1" >> $GITHUB_ENV
shell: bash

- name: Set include dsym flag
if: ${{ inputs.include-debug-info-for-macos && startsWith(inputs.platform-tag, 'macosx') }}
Expand Down Expand Up @@ -328,7 +329,11 @@ jobs:
auditwheel repair -w {dest_dir} {wheel} &&
auditwheel show {dest_dir}/* &&
rm -rf $WHEEL_DIR
CIBW_REPAIR_WHEEL_COMMAND_WINDOWS: "delvewheel repair -vv --add-path ./aerospike-client-c/vs/x64/Release -w {dest_dir} {wheel}"
# --no-mangle-all to make sure .pdb files match the .dll files
# delvewheel mangles the .dll file names but not the .pdb file names
# --include-symbols to include the .pdb files in the wheel
# TODO: need to find way to add path properly here
CIBW_REPAIR_WHEEL_COMMAND_WINDOWS: "delvewheel repair -vv --add-path ./aerospike-client-c/vs/x64/Debug --no-mangle-all --include-symbols -w {dest_dir} {wheel}"
# We also want to verify the same thing on macos
CIBW_REPAIR_WHEEL_COMMAND_MACOS: >
delocate-wheel --require-archs {delocate_archs} -w {dest_dir} -v {wheel} &&
Expand Down Expand Up @@ -437,10 +442,32 @@ jobs:
working-directory: test
shell: bash

- run: python3 -m pytest -vvs --full-trace new_tests/${{ inputs.test-file }}
- if: ${{ inputs.platform-tag == 'win_amd64' }}
id: run-tests
run: |
curl -O https://raw.githubusercontent.com/python/cpython/refs/heads/$PYTHON_VERSION/Misc/valgrind-python.supp
export _NT_SYMBOL_PATH=$(pip show aerospike | grep Location | cut -f 2- -d' ')
export PYTHONMALLOC=malloc
mkdir dumps
drmemory -light -suppress valgrind-python.supp -logdir dumps -- python3 -m pytest -vvs --full-trace new_tests/${{ inputs.test-file }}
# drmemory -callstack_max_frames 30 -lib_allowlist_frames 30 -lib_allowlist '**/*.pyd,**/aerospike.dll' -- python3 -m pytest -vvs --full-trace new_tests/${{ inputs.test-file }}
# run: |
# mkdir dumps
# procdump -accepteula -e -x ./dumps python3 -m pytest -vvs --full-trace new_tests/${{ inputs.test-file }}
working-directory: test
shell: bash

# - if: ${{ failure() && steps.run-tests.outcome == 'failure' }}
- uses: actions/upload-artifact@b7c566a772e6b6bfb58ed0dc250532a479d7789f # v6.0.0
with:
path: ./test/dumps/*
name: dump-${{ matrix.python-tag }}
if-no-files-found: error

# - run: python3 -m pytest -vvs --full-trace new_tests/${{ inputs.test-file }}
# working-directory: test
# shell: bash

- name: Show job status for commit
if: ${{ always() && github.event_name != 'push' && github.event_name != 'pull_request' }}
uses: myrotvorets/set-commit-status-action@3730c0a348a2ace3c110851bed53331bc6406e9f # v2.0.1
Expand Down
2 changes: 1 addition & 1 deletion .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@
path = aerospike-client-c
# url = git@github.com:aerospike/aerospike-client-c.git
url = https://github.com/aerospike/aerospike-client-c.git
branch = stage
branch = CLIENT-4327
28 changes: 22 additions & 6 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -119,8 +119,15 @@
extra_compile_args.append('-ftest-coverage')
extra_link_args.append('-lgcov')

data_files = []

if UNOPTIMIZED:
extra_compile_args.append('-O0')
if WINDOWS:
extra_compile_args.append('/Zi')
extra_link_args.append('/DEBUG')
# data_files.append("*.pdb")
else:
extra_compile_args.append('-O0')

################################################################################
# STATIC SSL LINKING BUILD SETTINGS
Expand All @@ -140,6 +147,11 @@
################################################################################

if WINDOWS:
if UNOPTIMIZED:
VS_PROJECT_CONFIGURATION = "Debug"
else:
VS_PROJECT_CONFIGURATION = "Release"

AEROSPIKE_C_TARGET = AEROSPIKE_C_HOME
tree = ET.parse(f"{AEROSPIKE_C_TARGET}/vs/aerospike/packages.config")
packages = tree.getroot()
Expand All @@ -166,7 +178,10 @@
libraries = libraries + ['rt']
AEROSPIKE_C_TARGET = AEROSPIKE_C_HOME + '/target/Linux-' + machine
elif WINDOWS:
libraries.append("pthreadVC2")
if UNOPTIMIZED:
libraries.append("pthreadVC2d")
else:
libraries.append("pthreadVC2")
extra_compile_args.append("-DAS_SHARED_IMPORT")
include_dirs.append(f"{AEROSPIKE_C_TARGET}/vs/packages/aerospike-client-c-dependencies.{c_client_dependencies_version}/build/native/include")
else:
Expand All @@ -184,9 +199,9 @@
]
else:
include_dirs.append(AEROSPIKE_C_TARGET + '/src/include')
library_dirs.append(f"{AEROSPIKE_C_TARGET}/vs/packages/aerospike-client-c-dependencies.{c_client_dependencies_version}/build/native/lib/x64/Release")
library_dirs.append(f"{AEROSPIKE_C_TARGET}/vs/packages/aerospike-client-c-dependencies.{c_client_dependencies_version}/build/native/lib/x64/{VS_PROJECT_CONFIGURATION}")
# Needed for linking the Python client with the C client
extra_objects.append(AEROSPIKE_C_TARGET + "/vs/x64/Release/aerospike.lib")
extra_objects.append(AEROSPIKE_C_TARGET + f"/vs/x64/{VS_PROJECT_CONFIGURATION}/aerospike.lib")

os.putenv('CPATH', ':'.join(include_dirs))
os.environ['CPATH'] = ':'.join(include_dirs)
Expand Down Expand Up @@ -230,7 +245,7 @@ def clean():
cmd = [
'msbuild',
'vs/aerospike.sln',
'/property:Configuration=Release'
f"/property:Configuration={VS_PROJECT_CONFIGURATION}"
]
else:
cmd = [
Expand Down Expand Up @@ -324,5 +339,6 @@ def clean():
cmdclass={
'build': CClientBuild,
'clean': CClientClean
}
},
data_files=data_files
)
2 changes: 1 addition & 1 deletion test/new_tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -239,7 +239,7 @@ def invalid_key(request):
yield request.param


# aerospike.set_log_level(aerospike.LOG_LEVEL_DEBUG)
aerospike.set_log_level(aerospike.LOG_LEVEL_DEBUG)
# aerospike.set_log_handler(None)

def verify_record_ttl(client: aerospike.Client, key, expected_ttl: int):
Expand Down
32 changes: 12 additions & 20 deletions test/new_tests/test_admin_change_password.py
Original file line number Diff line number Diff line change
Expand Up @@ -77,12 +77,10 @@ def test_change_password_with_invalid_timeout_policy_value(self):
user = "testchangepassworduser"
password = "newpassword"

try:
with pytest.raises(aerospike.exception.ParamError) as excinfo:
self.client.admin_change_password(user, password, policy)

except aerospike.exception.ParamError as exception:
assert exception.code == -2
assert exception.msg == "timeout is invalid"
assert excinfo.value.code == -2
assert excinfo.value.msg == "timeout is invalid"

# NOTE: This will fail if auth_mode is PKI_AUTH (3).
@pytest.mark.xfail(reason="Might fail depending on auth_mode.")
Expand Down Expand Up @@ -116,36 +114,30 @@ def test_change_password_with_none_username(self):
user = None
password = "newpassword"

try:
with pytest.raises(aerospike.exception.ParamError) as excinfo:
self.client.admin_change_password(user, password)

except aerospike.exception.ParamError as exception:
assert exception.code == -2
assert exception.msg == "Username should be a string"
assert excinfo.value.code == -2
assert excinfo.value.msg == "Username should be a string"

def test_change_password_with_none_password(self):

user = "testchangepassworduser"
password = None

try:
with pytest.raises(aerospike.exception.ParamError) as excinfo:
self.client.admin_change_password(user, password)

except aerospike.exception.ParamError as exception:
assert exception.code == -2
assert exception.msg == "Password should be a string"
assert excinfo.value.code == -2
assert excinfo.value.msg == "Password should be a string"

def test_change_password_with_non_existent_user(self):

user = "readwriteuser"
password = "newpassword"

try:
with pytest.raises(aerospike.exception.InvalidUser) as excinfo:
self.client.admin_change_password(user, password)

except aerospike.exception.InvalidUser as exception:
assert exception.code == 60
assert exception.msg == "AEROSPIKE_INVALID_USER"
assert excinfo.value.code == 60
assert excinfo.value.msg == "AEROSPIKE_INVALID_USER"

def test_change_password_with_too_long_password(self):

Expand Down
38 changes: 15 additions & 23 deletions test/new_tests/test_admin_create_role.py
Original file line number Diff line number Diff line change
Expand Up @@ -250,11 +250,10 @@ def test_create_role_incorrect_role_type(self):
"""
role name not string
"""
try:
with pytest.raises(e.ParamError) as excinfo:
self.client.admin_create_role(1, [{"code": aerospike.PRIV_USER_ADMIN}])
except e.ParamError as exception:
assert exception.code == -2
assert "Role name should be a string" in exception.msg
assert excinfo.value.code == -2
assert "Role name should be a string" in excinfo.value.msg

def test_create_role_unknown_privilege_type(self):
"""
Expand All @@ -268,21 +267,18 @@ def test_create_role_unknown_privilege_type(self):
except e.InvalidRole:
pass # we are good, no such role exists

try:
with pytest.raises(e.InvalidPrivilege) as excinfo:
self.client.admin_create_role("usr-sys-admin-test", [{"code": 64}])
except e.InvalidPrivilege as exception:
assert exception.code == 72
assert excinfo.value.code == 72

def test_create_role_incorrect_privilege_type(self):
"""
privilege type incorrect
"""
try:
with pytest.raises(e.ParamError) as excinfo:
self.client.admin_create_role("usr-sys-admin-test", None)

except e.ParamError as exception:
assert exception.code == -2
assert exception.msg == "Privileges should be a list"
assert excinfo.value.code == -2
assert excinfo.value.msg == "Privileges should be a list"

def test_create_role_existing_role(self):
"""
Expand All @@ -299,16 +295,14 @@ def test_create_role_existing_role(self):
self.client.admin_create_role(
"usr-sys-admin-test", [{"code": aerospike.PRIV_USER_ADMIN}, {"code": aerospike.PRIV_SYS_ADMIN}]
)
try:
time.sleep(2)
with pytest.raises(e.RoleExistsError) as excinfo:
self.client.admin_create_role(
"usr-sys-admin-test", [{"code": aerospike.PRIV_USER_ADMIN}, {"code": aerospike.PRIV_SYS_ADMIN}]
)
assert excinfo.value.code == 71
assert excinfo.value.msg == "AEROSPIKE_ROLE_ALREADY_EXISTS"

except e.RoleExistsError as exception:
assert exception.code == 71
assert exception.msg == "AEROSPIKE_ROLE_ALREADY_EXISTS"

time.sleep(1)
status = self.client.admin_drop_role("usr-sys-admin-test")

assert status == 0
Expand Down Expand Up @@ -364,11 +358,9 @@ def test_create_role_positive_with_too_long_role_name(self):
"""
role_name = "role$" * 1000

try:
with pytest.raises(e.InvalidRole) as excinfo:
self.client.admin_create_role(
role_name, [{"code": aerospike.PRIV_READ, "ns": "test", "set": "demo"}]
)

except e.InvalidRole as exception:
assert exception.code == 70
assert exception.msg == "AEROSPIKE_INVALID_ROLE"
assert excinfo.value.code == 70
assert excinfo.value.msg == "AEROSPIKE_INVALID_ROLE"
49 changes: 18 additions & 31 deletions test/new_tests/test_admin_create_user.py
Original file line number Diff line number Diff line change
Expand Up @@ -108,12 +108,10 @@ def test_create_user_with_invalid_timeout_policy_value(self):
except Exception:
pass

try:
with pytest.raises(e.ParamError) as excinfo:
self.client.admin_create_user(user, password, roles, policy)

except e.ParamError as exception:
assert exception.code == -2
assert exception.msg == "timeout is invalid"
assert excinfo.value.code == -2
assert excinfo.value.msg == "timeout is invalid"

def test_create_user_with_proper_timeout_policy_value(self):

Expand Down Expand Up @@ -146,25 +144,21 @@ def test_create_user_with_none_username(self):
password = "user3-test"
roles = ["sys-admin"]

try:
with pytest.raises(e.ParamError) as excinfo:
self.client.admin_create_user(user, password, roles)

except e.ParamError as exception:
assert exception.code == -2
assert exception.msg == "Username should be a string"
assert excinfo.value.code == -2
assert excinfo.value.msg == "Username should be a string"

def test_create_user_with_empty_username(self):

user = ""
password = "user3-test"
roles = ["read-write"]

try:
with pytest.raises(e.InvalidUser) as excinfo:
self.client.admin_create_user(user, password, roles)

except e.InvalidUser as exception:
assert exception.code == 60
assert exception.msg == "AEROSPIKE_INVALID_USER"
assert excinfo.value.code == 60
assert excinfo.value.msg == "AEROSPIKE_INVALID_USER"

def test_create_user_with_special_characters_in_username(self):

Expand All @@ -190,12 +184,10 @@ def test_create_user_with_none_password(self):
password = None
roles = ["sys-admin"]

try:
with pytest.raises(e.ParamError) as excinfo:
self.client.admin_create_user(user, password, roles)

except e.ParamError as exception:
assert exception.code == -2
assert exception.msg == "Password should be a string"
assert excinfo.value.code == -2
assert excinfo.value.msg == "Password should be a string"

def test_create_user_with_empty_string_as_password(self):

Expand Down Expand Up @@ -245,15 +237,12 @@ def test_create_user_with_too_long_username(self):
except Exception:
pass

try:
with pytest.raises((e.InvalidUser, e.ClientError)) as excinfo:
self.client.admin_create_user(user, password, roles)

except e.InvalidUser as exception:
assert exception.code == 60
assert exception.msg == "AEROSPIKE_INVALID_USER"

except e.ClientError:
pass
if excinfo.type == e.InvalidUser:
assert excinfo.value.code == 60
assert excinfo.value.msg == "AEROSPIKE_INVALID_USER"

def test_create_user_with_too_long_password(self):

Expand Down Expand Up @@ -310,7 +299,7 @@ def test_create_user_with_non_user_admin_user(self):

non_admin_client = None

try:
with pytest.raises(e.RoleViolation) as excinfo:
# Close and reconnect with non_admin_test user
non_admin_client = aerospike.client(config)
non_admin_client.close()
Expand All @@ -319,9 +308,7 @@ def test_create_user_with_non_user_admin_user(self):

if non_admin_client:
non_admin_client.close()

except e.RoleViolation as exception:
assert exception.code == 81
assert excinfo.value.code == 81

self.delete_users.append("non_admin_test")

Expand Down
Loading
Loading