From 6af38c89bfc9d695242d51fb87a69f6c3765fc77 Mon Sep 17 00:00:00 2001 From: Julian Nguyen <109386615+juliannguyen4@users.noreply.github.com> Date: Wed, 15 Jul 2026 15:26:00 -0700 Subject: [PATCH 01/28] Add tests for a subset of all the policies that support the key option. I'm not sure if read policy would cause read commands to store the user key, and sending the key for remove/batch_remove doesn't make sense to me. TODO - apply/batch_apply policies hasn't been finished yet --- doc/client.rst | 18 ++--- doc/key_option_with_union_precedence.rst | 5 ++ test/new_tests/conftest.py | 19 +++++- test/new_tests/test_dynamic_config.py | 9 +-- .../test_send_key_union_precedence.py | 67 +++++++++++++++++++ 5 files changed, 97 insertions(+), 21 deletions(-) create mode 100644 doc/key_option_with_union_precedence.rst create mode 100644 test/new_tests/test_send_key_union_precedence.py diff --git a/doc/client.rst b/doc/client.rst index 3f80225b34..9279dcfe6c 100755 --- a/doc/client.rst +++ b/doc/client.rst @@ -2141,10 +2141,8 @@ Write Policies .. hlist:: :columns: 1 - * **key** - | One of the :ref:`POLICY_KEY` values such as :data:`aerospike.POLICY_KEY_DIGEST` - | - | Default: :data:`aerospike.POLICY_KEY_DIGEST` + * .. include:: ./key_option_with_union_precedence.rst + * **exists** | One of the :ref:`POLICY_EXISTS` values such as :data:`aerospike.POLICY_EXISTS_CREATE` | @@ -2256,10 +2254,8 @@ Operate Policies .. hlist:: :columns: 1 - * **key** - | One of the :ref:`POLICY_KEY` values such as :data:`aerospike.POLICY_KEY_DIGEST` - | - | Default: :data:`aerospike.POLICY_KEY_DIGEST` + * .. include:: ./key_option_with_union_precedence.rst + * **gen** | One of the :ref:`POLICY_GEN` values such as :data:`aerospike.POLICY_GEN_IGNORE` | @@ -2509,10 +2505,8 @@ Batch Write Policies .. hlist:: :columns: 1 - * **key** - | One of the :ref:`POLICY_KEY` values such as :data:`aerospike.POLICY_KEY_DIGEST` - | - | Default: :data:`aerospike.POLICY_KEY_DIGEST` + * .. include:: ./key_option_with_union_precedence.rst + * **commit_level** | One of the :ref:`POLICY_COMMIT_LEVEL` values such as :data:`aerospike.POLICY_COMMIT_LEVEL_ALL` | diff --git a/doc/key_option_with_union_precedence.rst b/doc/key_option_with_union_precedence.rst new file mode 100644 index 0000000000..f94eb216ff --- /dev/null +++ b/doc/key_option_with_union_precedence.rst @@ -0,0 +1,5 @@ +**key** + +One of the :ref:`POLICY_KEY` values such as :data:`aerospike.POLICY_KEY_DIGEST` + +Default: :data:`aerospike.POLICY_KEY_DIGEST` diff --git a/test/new_tests/conftest.py b/test/new_tests/conftest.py index a4de68835b..0d9bf9dce0 100644 --- a/test/new_tests/conftest.py +++ b/test/new_tests/conftest.py @@ -276,10 +276,16 @@ def wait_for_job_completion(as_connection, job_id, job_module: int = aerospike.J # Add records around the test @pytest.fixture(scope="function") -def clean_test_background(as_connection): +# TODO: improve fixture naming +def clean_test_background(request, as_connection): + if hasattr(request, "param") and isinstance(request.param, int): + num_keys = request.param + else: + num_keys = len(KEYS) + batch_records = [] brs = BatchRecords(batch_records=batch_records) - for i, key in enumerate(KEYS): + for i, key in enumerate(KEYS[:num_keys]): ops = [ operations.write(BIN_NAME, i), operations.write(MAP_BIN_NAME, {"a": i}) @@ -291,6 +297,15 @@ def clean_test_background(as_connection): yield as_connection.batch_remove(KEYS) +def expect_records_to_have_user_key_stored(client: aerospike.Client, key: int | str | bytearray): + query = client.query("test", "demo") + recs = query.results() + + # Check that record key tuple has the primary key + for record in recs: + first_record_pk = record[0] + assert first_record_pk[2] == key + BASIC_READ_BIN_OPS = [ operations.read(BIN_NAME) ] diff --git a/test/new_tests/test_dynamic_config.py b/test/new_tests/test_dynamic_config.py index b68c8816ab..1287b9fe0c 100644 --- a/test/new_tests/test_dynamic_config.py +++ b/test/new_tests/test_dynamic_config.py @@ -1,5 +1,6 @@ import aerospike from aerospike import exception as e +from .conftest import expect_records_to_have_user_key_stored from .test_base_class import TestBaseClass import pytest import os @@ -93,13 +94,7 @@ def test_dyn_config_file_works(self, functional_test_setup): # "Send key" is enabled in dynamic config # The key should be returned here - query = self.client.query("test", "demo") - recs = query.results() - assert len(recs) == 1 - # Check that record key tuple has the primary key - first_record = recs[0] - first_record_key = first_record[0] - assert first_record_key[2] is self.key[2] + expect_records_to_have_user_key_stored(self.client, self.key[2]) def test_enable_metrics_cannot_override_dyn_config(self, show_more_logs): config = TestBaseClass.get_connection_config() diff --git a/test/new_tests/test_send_key_union_precedence.py b/test/new_tests/test_send_key_union_precedence.py new file mode 100644 index 0000000000..83fa1de7af --- /dev/null +++ b/test/new_tests/test_send_key_union_precedence.py @@ -0,0 +1,67 @@ +import pytest +from .test_base_class import TestBaseClass +import aerospike +from .conftest import KEYS, BIN_NAME, expect_records_to_have_user_key_stored +from aerospike_helpers.operations import operations + + +config = TestBaseClass.get_connection_config() + + +# TODO: is this applied properly? +@pytest.mark.parametrize( + "clean_test_background", + [1], + indirect=True +) +class TestSendKeyUnionPrecedence: + @pytest.fixture(autouse=True) + def setup(self, clean_test_background): + pass + + def test_client_config_overrides_command_level_write_policy(self): + config["policies"]["write"]["key"] = True + client = aerospike.client(config) + + KEY = KEYS[0] + client.put(KEY, bins={BIN_NAME: "a"}) + + expect_records_to_have_user_key_stored(client, KEY[2]) + + def test_client_config_overrides_command_level_operate_policy(self): + config["policies"]["operate"]["key"] = True + client = aerospike.client(config) + + KEY = KEYS[0] + ops = [ + operations.write(BIN_NAME, "a") + ] + client.operate(KEY, ops) + + expect_records_to_have_user_key_stored(client, KEY[2]) + + # def test_client_config_overrides_command_level_apply_policy(self): + # config["policies"]["apply"]["key"] = True + # client = connection_with_udf + + # KEY = KEYS[0] + + # client.apply(KEY, "example.lua") + + # expect_records_to_have_user_key_stored(client, KEY[2]) + + def test_client_config_overrides_command_level_batch_write_policy(self): + config["policies"]["batch_write"] = { + "key": True + } + client = aerospike.client(config) + + KEY = KEYS[0] + ops = [ + operations.write(BIN_NAME, "a") + ] + client.batch_operate([KEY], ops) + + expect_records_to_have_user_key_stored(client, KEY[2]) + + # TODO: batch apply From 5fde297a78d91ae56fd8fd9ff666487936bcf209 Mon Sep 17 00:00:00 2001 From: Julian Nguyen <109386615+juliannguyen4@users.noreply.github.com> Date: Wed, 15 Jul 2026 15:56:03 -0700 Subject: [PATCH 02/28] Add first draft of apply/batch_apply send key test cases. --- .../test_send_key_union_precedence.py | 27 ++++++++++++++----- 1 file changed, 20 insertions(+), 7 deletions(-) diff --git a/test/new_tests/test_send_key_union_precedence.py b/test/new_tests/test_send_key_union_precedence.py index 83fa1de7af..933d6fb166 100644 --- a/test/new_tests/test_send_key_union_precedence.py +++ b/test/new_tests/test_send_key_union_precedence.py @@ -40,15 +40,17 @@ def test_client_config_overrides_command_level_operate_policy(self): expect_records_to_have_user_key_stored(client, KEY[2]) - # def test_client_config_overrides_command_level_apply_policy(self): - # config["policies"]["apply"]["key"] = True - # client = connection_with_udf + def test_client_config_overrides_command_level_apply_policy(self): + config["policies"]["apply"]["key"] = True + client = aerospike.client(config) + # TODO: this needs to be set in a fixture... + client.udf_put("query_apply.lua") - # KEY = KEYS[0] + KEY = KEYS[0] - # client.apply(KEY, "example.lua") + client.apply(KEY, "query_apply", "mark_as_applied_one_arg", ["a"]) - # expect_records_to_have_user_key_stored(client, KEY[2]) + expect_records_to_have_user_key_stored(client, KEY[2]) def test_client_config_overrides_command_level_batch_write_policy(self): config["policies"]["batch_write"] = { @@ -64,4 +66,15 @@ def test_client_config_overrides_command_level_batch_write_policy(self): expect_records_to_have_user_key_stored(client, KEY[2]) - # TODO: batch apply + def test_client_config_overrides_command_level_batch_apply_policy(self): + config["policies"]["batch_apply"] = { + "key": True + } + client = aerospike.client(config) + client.udf_put("query_apply.lua") + + KEY = KEYS[0] + + client.batch_apply([KEY], "query_apply", "mark_as_applied_one_arg", ["a"]) + + expect_records_to_have_user_key_stored(client, KEY[2]) From dc1ae8d94c4289ada4103404919fb8cbd2ee815e Mon Sep 17 00:00:00 2001 From: Julian Nguyen <109386615+juliannguyen4@users.noreply.github.com> Date: Wed, 15 Jul 2026 16:11:07 -0700 Subject: [PATCH 03/28] Also document batch_apply and apply policies' key option properly uses union precedence now that the tests have verified that behavior. --- doc/client.rst | 13 ++----------- 1 file changed, 2 insertions(+), 11 deletions(-) diff --git a/doc/client.rst b/doc/client.rst index 9279dcfe6c..07bad616c7 100755 --- a/doc/client.rst +++ b/doc/client.rst @@ -2142,7 +2142,6 @@ Write Policies :columns: 1 * .. include:: ./key_option_with_union_precedence.rst - * **exists** | One of the :ref:`POLICY_EXISTS` values such as :data:`aerospike.POLICY_EXISTS_CREATE` | @@ -2255,7 +2254,6 @@ Operate Policies :columns: 1 * .. include:: ./key_option_with_union_precedence.rst - * **gen** | One of the :ref:`POLICY_GEN` values such as :data:`aerospike.POLICY_GEN_IGNORE` | @@ -2339,10 +2337,7 @@ Apply Policies .. hlist:: :columns: 1 - * **key** - | One of the :ref:`POLICY_KEY` values such as :data:`aerospike.POLICY_KEY_DIGEST` - | - | Default: :data:`aerospike.POLICY_KEY_DIGEST` + * .. include:: ./key_option_with_union_precedence.rst * **replica** | One of the :ref:`POLICY_REPLICA` values such as :data:`aerospike.POLICY_REPLICA_MASTER` | @@ -2506,7 +2501,6 @@ Batch Write Policies :columns: 1 * .. include:: ./key_option_with_union_precedence.rst - * **commit_level** | One of the :ref:`POLICY_COMMIT_LEVEL` values such as :data:`aerospike.POLICY_COMMIT_LEVEL_ALL` | @@ -2558,10 +2552,7 @@ Batch Apply Policies .. hlist:: :columns: 1 - * **key** - | One of the :ref:`POLICY_KEY` values such as :data:`aerospike.POLICY_KEY_DIGEST` - | - | Default: :data:`aerospike.POLICY_KEY_DIGEST` + * .. include:: ./key_option_with_union_precedence.rst * **commit_level** | One of the :ref:`POLICY_COMMIT_LEVEL` values such as :data:`aerospike.POLICY_COMMIT_LEVEL_ALL` | From b3ab0d2452d9250f95995ba0ac943c077b4a9d3c Mon Sep 17 00:00:00 2001 From: Julian Nguyen <109386615+juliannguyen4@users.noreply.github.com> Date: Wed, 15 Jul 2026 16:19:33 -0700 Subject: [PATCH 04/28] Cleanup test code. --- .../test_send_key_union_precedence.py | 22 +++++-------------- 1 file changed, 6 insertions(+), 16 deletions(-) diff --git a/test/new_tests/test_send_key_union_precedence.py b/test/new_tests/test_send_key_union_precedence.py index 933d6fb166..f59d5bfd75 100644 --- a/test/new_tests/test_send_key_union_precedence.py +++ b/test/new_tests/test_send_key_union_precedence.py @@ -6,24 +6,20 @@ config = TestBaseClass.get_connection_config() +KEY = KEYS[0] -# TODO: is this applied properly? @pytest.mark.parametrize( "clean_test_background", [1], indirect=True ) +@pytest.mark.usefixtures("clean_test_background") class TestSendKeyUnionPrecedence: - @pytest.fixture(autouse=True) - def setup(self, clean_test_background): - pass - def test_client_config_overrides_command_level_write_policy(self): config["policies"]["write"]["key"] = True client = aerospike.client(config) - KEY = KEYS[0] client.put(KEY, bins={BIN_NAME: "a"}) expect_records_to_have_user_key_stored(client, KEY[2]) @@ -32,7 +28,6 @@ def test_client_config_overrides_command_level_operate_policy(self): config["policies"]["operate"]["key"] = True client = aerospike.client(config) - KEY = KEYS[0] ops = [ operations.write(BIN_NAME, "a") ] @@ -40,13 +35,12 @@ def test_client_config_overrides_command_level_operate_policy(self): expect_records_to_have_user_key_stored(client, KEY[2]) - def test_client_config_overrides_command_level_apply_policy(self): + udf_to_load = "example.lua" + + def test_client_config_overrides_command_level_apply_policy(self, connection_with_udf): config["policies"]["apply"]["key"] = True client = aerospike.client(config) - # TODO: this needs to be set in a fixture... - client.udf_put("query_apply.lua") - KEY = KEYS[0] client.apply(KEY, "query_apply", "mark_as_applied_one_arg", ["a"]) @@ -58,7 +52,6 @@ def test_client_config_overrides_command_level_batch_write_policy(self): } client = aerospike.client(config) - KEY = KEYS[0] ops = [ operations.write(BIN_NAME, "a") ] @@ -66,14 +59,11 @@ def test_client_config_overrides_command_level_batch_write_policy(self): expect_records_to_have_user_key_stored(client, KEY[2]) - def test_client_config_overrides_command_level_batch_apply_policy(self): + def test_client_config_overrides_command_level_batch_apply_policy(self, connection_with_udf): config["policies"]["batch_apply"] = { "key": True } client = aerospike.client(config) - client.udf_put("query_apply.lua") - - KEY = KEYS[0] client.batch_apply([KEY], "query_apply", "mark_as_applied_one_arg", ["a"]) From b8d3541bbd443f18d3f4c9d86aa5eecd248074e6 Mon Sep 17 00:00:00 2001 From: Julian Nguyen <109386615+juliannguyen4@users.noreply.github.com> Date: Wed, 15 Jul 2026 16:22:34 -0700 Subject: [PATCH 05/28] Improve fixture naming. --- test/new_tests/conftest.py | 5 ++-- .../test_query_execute_background.py | 26 +++++++++---------- .../test_send_key_union_precedence.py | 4 +-- 3 files changed, 17 insertions(+), 18 deletions(-) diff --git a/test/new_tests/conftest.py b/test/new_tests/conftest.py index 0d9bf9dce0..c69c43c885 100644 --- a/test/new_tests/conftest.py +++ b/test/new_tests/conftest.py @@ -276,8 +276,7 @@ def wait_for_job_completion(as_connection, job_id, job_module: int = aerospike.J # Add records around the test @pytest.fixture(scope="function") -# TODO: improve fixture naming -def clean_test_background(request, as_connection): +def insert_records(request, as_connection): if hasattr(request, "param") and isinstance(request.param, int): num_keys = request.param else: @@ -322,7 +321,7 @@ def expect_records_to_have_user_key_stored(client: aerospike.Client, key: int | NON_EXISTENT_BIN_NAME = "asdf" @pytest.fixture() -def query(request, clean_test_background, as_connection): +def query(request, insert_records, as_connection): if not hasattr(request, "param"): query = as_connection.query(TEST_NS, TEST_SET) else: diff --git a/test/new_tests/test_query_execute_background.py b/test/new_tests/test_query_execute_background.py index 36a9d239ac..6df02ce75f 100644 --- a/test/new_tests/test_query_execute_background.py +++ b/test/new_tests/test_query_execute_background.py @@ -52,7 +52,7 @@ class TestQueryApply(object): def setup(self, connection_with_config_funcs): pass - def test_background_execute_return_val(self, clean_test_background): + def test_background_execute_return_val(self, insert_records): """ Ensure that Query.execute_background() returns an int like object """ @@ -63,7 +63,7 @@ def test_background_execute_return_val(self, clean_test_background): assert isinstance(res, (int, long)) @pytest.mark.xfail(reason="This started failing when adding support for bin projection due to query.ttl not being applied") - def test_background_with_ttl(self, clean_test_background): + def test_background_with_ttl(self, insert_records): """ Ensure that ttl is set for the record found with background query """ @@ -87,7 +87,7 @@ def test_background_with_ttl(self, clean_test_background): skew_tolerance_secs = 50 assert meta["ttl"] in range(query.ttl - skew_tolerance_secs, query.ttl + skew_tolerance_secs) - def test_background_execute_no_predicate(self, clean_test_background): + def test_background_execute_no_predicate(self, insert_records): """ Ensure that Query.execute_background() gets applied to all records """ @@ -103,7 +103,7 @@ def test_background_execute_no_predicate(self, clean_test_background): validate_records(self.as_connection, keys, lambda rec: rec[test_bin] == "aerospike") - def test_background_execute_exp_everywhere(self, clean_test_background): + def test_background_execute_exp_everywhere(self, insert_records): """ Ensure that Query.execute_background() gets applied to records that match the exp """ @@ -137,7 +137,7 @@ def test_background_execute_exp_everywhere(self, clean_test_background): assert bins.get(test_bin) is None @pytest.mark.xfail(reason="predicate and exp used at same time") - def test_background_execute_exp_and_predicate(self, clean_test_background): + def test_background_execute_exp_and_predicate(self, insert_records): """ Ensure that Query.execute_background() gets applied to records that match the predicate NOTE: the predicate overrides the exp @@ -165,7 +165,7 @@ def test_background_execute_exp_and_predicate(self, clean_test_background): else: assert bins.get(test_bin) is None - def test_background_execute_with_ops_and_exp(self, clean_test_background): + def test_background_execute_with_ops_and_exp(self, insert_records): """ Ensure that Query.execute_background() applies ops to records that match the expressions. """ @@ -198,7 +198,7 @@ def test_background_execute_with_ops_and_exp(self, clean_test_background): else: assert bins.get(test_bin) is None - def test_background_execute_with_ops(self, clean_test_background): + def test_background_execute_with_ops(self, insert_records): """ Ensure that Query.execute_background() applies ops to all records """ @@ -217,7 +217,7 @@ def test_background_execute_with_ops(self, clean_test_background): validate_records(self.as_connection, keys, lambda rec: rec[test_bin] == "new_val") - def test_background_execute_with_ops_and_preds(self, clean_test_background): + def test_background_execute_with_ops_and_preds(self, insert_records): """ Ensure that Query.execute_background() applies ops to records that match the predicate """ @@ -252,7 +252,7 @@ def test_background_execute_with_ops_and_preds(self, clean_test_background): validate_records(self.as_connection, keys, lambda rec: rec[test_bin] == "aerospike") - def test_background_execute_sindex_predicate(self, clean_test_background): + def test_background_execute_sindex_predicate(self, insert_records): """ Ensure that Query.execute_background() only applies to records matched by the specified predicate @@ -272,7 +272,7 @@ def test_background_execute_sindex_predicate(self, clean_test_background): _, _, num_5_record = self.as_connection.get((TEST_NS, TEST_SET, 5)) assert num_5_record[test_bin] == "aerospike" - def test_background_execute_sindex_exp(self, clean_test_background): + def test_background_execute_sindex_exp(self, insert_records): """ Ensure that Query.execute_background() only applies to records matched by the specified predicate @@ -301,7 +301,7 @@ def test_background_execute_sindex_exp(self, clean_test_background): # Records with number < 10 should have had the udf applied validate_records(self.as_connection, keys[:10], lambda rec: rec[test_bin] == "aerospike") - def test_background_execute_with_policy(self, clean_test_background): + def test_background_execute_with_policy(self, insert_records): """ Ensure that Query.execute_background() returns an int like object """ @@ -311,7 +311,7 @@ def test_background_execute_with_policy(self, clean_test_background): res = query.execute_background({"socket_timeout": 180000}) assert isinstance(res, (int, long)) - def test_background_execute_with_policy_kwarg(self, clean_test_background): + def test_background_execute_with_policy_kwarg(self, insert_records): """ Ensure that Query.execute_background() returns an int like object """ @@ -321,7 +321,7 @@ def test_background_execute_with_policy_kwarg(self, clean_test_background): res = query.execute_background(policy={}) assert isinstance(res, (int, long)) - def test_background_execute_with_invalid_policy_type(self, clean_test_background): + def test_background_execute_with_invalid_policy_type(self, insert_records): """ Ensure that Query.execute_background() returns an int like object """ diff --git a/test/new_tests/test_send_key_union_precedence.py b/test/new_tests/test_send_key_union_precedence.py index f59d5bfd75..2ad7b37317 100644 --- a/test/new_tests/test_send_key_union_precedence.py +++ b/test/new_tests/test_send_key_union_precedence.py @@ -10,11 +10,11 @@ @pytest.mark.parametrize( - "clean_test_background", + "insert_records", [1], indirect=True ) -@pytest.mark.usefixtures("clean_test_background") +@pytest.mark.usefixtures("insert_records") class TestSendKeyUnionPrecedence: def test_client_config_overrides_command_level_write_policy(self): config["policies"]["write"]["key"] = True From 76e51a7e070b6b3bcb0307d2891f03f039402d6a Mon Sep 17 00:00:00 2001 From: Julian Nguyen <109386615+juliannguyen4@users.noreply.github.com> Date: Wed, 15 Jul 2026 16:31:55 -0700 Subject: [PATCH 06/28] Document union precedence for policies in which the key option was tested --- doc/key_option_with_union_precedence.rst | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/doc/key_option_with_union_precedence.rst b/doc/key_option_with_union_precedence.rst index f94eb216ff..57395936b1 100644 --- a/doc/key_option_with_union_precedence.rst +++ b/doc/key_option_with_union_precedence.rst @@ -2,4 +2,8 @@ One of the :ref:`POLICY_KEY` values such as :data:`aerospike.POLICY_KEY_DIGEST` +This option is unique from other options such that it uses union precedence; +if this is set to :data:`aerospike.POLICY_KEY_SEND` either in dynamic config, config-level, or command-level, +:data:`aerospike.POLICY_KEY_SEND` will always be applied. + Default: :data:`aerospike.POLICY_KEY_DIGEST` From 350a6d7bf379b76203bcf523908be2aa8102aff5 Mon Sep 17 00:00:00 2001 From: Julian Nguyen <109386615+juliannguyen4@users.noreply.github.com> Date: Wed, 15 Jul 2026 16:47:36 -0700 Subject: [PATCH 07/28] Add tests for dynamic config send key taking precedence for operate, apply, batch_write, and batch_apply policies. --- test/dyn_config.yml | 8 ++++ test/new_tests/conftest.py | 3 ++ test/new_tests/test_dynamic_config.py | 9 ++-- .../test_send_key_union_precedence.py | 45 ++++++++++++------- 4 files changed, 42 insertions(+), 23 deletions(-) diff --git a/test/dyn_config.yml b/test/dyn_config.yml index df3b9cb7a6..aaff923d83 100644 --- a/test/dyn_config.yml +++ b/test/dyn_config.yml @@ -4,6 +4,14 @@ dynamic: enable: true write: send_key: true + apply: + send_key: true + operate: + send_key: true + batch_write: + send_key: true + batch_apply: + send_key: true static: client: config_interval: 1000 diff --git a/test/new_tests/conftest.py b/test/new_tests/conftest.py index c69c43c885..817987118b 100644 --- a/test/new_tests/conftest.py +++ b/test/new_tests/conftest.py @@ -427,3 +427,6 @@ def hydrate_partitions_1000_to_1003(request, as_connection): yield as_connection.batch_remove(keys) + +AEROSPIKE_CLIENT_CONFIG_URL = "AEROSPIKE_CLIENT_CONFIG_URL" +DYN_CONFIG_PATH = "./dyn_config.yml" diff --git a/test/new_tests/test_dynamic_config.py b/test/new_tests/test_dynamic_config.py index 1287b9fe0c..fe10fc3ec6 100644 --- a/test/new_tests/test_dynamic_config.py +++ b/test/new_tests/test_dynamic_config.py @@ -1,12 +1,11 @@ import aerospike from aerospike import exception as e -from .conftest import expect_records_to_have_user_key_stored +from .conftest import expect_records_to_have_user_key_stored, AEROSPIKE_CLIENT_CONFIG_URL, DYN_CONFIG_PATH from .test_base_class import TestBaseClass import pytest import os import glob -DYN_CONFIG_PATH = "./dyn_config.yml" METRICS_LOG_FILES = "./metrics-*.log" @@ -53,8 +52,6 @@ def cleanup_metrics_logs(self): for item in metrics_log_filenames: os.remove(item) - AEROSPIKE_CLIENT_CONFIG_URL = "AEROSPIKE_CLIENT_CONFIG_URL" - @pytest.fixture def functional_test_setup(self, request, show_more_logs, cleanup_metrics_logs): config = TestBaseClass.get_connection_config() @@ -74,7 +71,7 @@ def functional_test_setup(self, request, show_more_logs, cleanup_metrics_logs): setup_client.close() if request.param is True: - del os.environ[self.AEROSPIKE_CLIENT_CONFIG_URL] + del os.environ[AEROSPIKE_CLIENT_CONFIG_URL] # Decide whether env var should be used or not to read dynamic config file. # If not using env var, use the config provider instead @@ -83,7 +80,7 @@ def functional_test_setup(self, request, show_more_logs, cleanup_metrics_logs): def test_dyn_config_file_works(self, functional_test_setup): config = TestBaseClass.get_connection_config() if functional_test_setup is True: - os.environ[self.AEROSPIKE_CLIENT_CONFIG_URL] = DYN_CONFIG_PATH + os.environ[AEROSPIKE_CLIENT_CONFIG_URL] = DYN_CONFIG_PATH else: provider = aerospike.ConfigProvider(DYN_CONFIG_PATH) config["config_provider"] = provider diff --git a/test/new_tests/test_send_key_union_precedence.py b/test/new_tests/test_send_key_union_precedence.py index 2ad7b37317..e242dbfe85 100644 --- a/test/new_tests/test_send_key_union_precedence.py +++ b/test/new_tests/test_send_key_union_precedence.py @@ -1,11 +1,11 @@ import pytest from .test_base_class import TestBaseClass import aerospike -from .conftest import KEYS, BIN_NAME, expect_records_to_have_user_key_stored +from .conftest import KEYS, BIN_NAME, expect_records_to_have_user_key_stored, AEROSPIKE_CLIENT_CONFIG_URL, DYN_CONFIG_PATH from aerospike_helpers.operations import operations +import os -config = TestBaseClass.get_connection_config() KEY = KEYS[0] @@ -15,18 +15,34 @@ indirect=True ) @pytest.mark.usefixtures("insert_records") +@pytest.mark.parametrize("override_dynamic_config", [False, True]) class TestSendKeyUnionPrecedence: + @pytest.fixture(autouse=True) + def set_key_option(self, request, override_dynamic_config: bool): + self.config = TestBaseClass.get_connection_config() + if override_dynamic_config: + os.environ[AEROSPIKE_CLIENT_CONFIG_URL] = DYN_CONFIG_PATH + else: + if request.param not in self.config["policies"]: + self.config["policies"][request.param] = {} + self.config["policies"][request.param]["key"] = True + + yield + + if override_dynamic_config: + del os.environ[AEROSPIKE_CLIENT_CONFIG_URL] + + @pytest.mark.parametrize("set_key_option", ["write"], indirect=True) def test_client_config_overrides_command_level_write_policy(self): - config["policies"]["write"]["key"] = True - client = aerospike.client(config) + client = aerospike.client(self.config) client.put(KEY, bins={BIN_NAME: "a"}) expect_records_to_have_user_key_stored(client, KEY[2]) + @pytest.mark.parametrize("set_key_option", ["operate"], indirect=True) def test_client_config_overrides_command_level_operate_policy(self): - config["policies"]["operate"]["key"] = True - client = aerospike.client(config) + client = aerospike.client(self.config) ops = [ operations.write(BIN_NAME, "a") @@ -37,20 +53,17 @@ def test_client_config_overrides_command_level_operate_policy(self): udf_to_load = "example.lua" + @pytest.mark.parametrize("set_key_option", ["apply"], indirect=True) def test_client_config_overrides_command_level_apply_policy(self, connection_with_udf): - config["policies"]["apply"]["key"] = True - client = aerospike.client(config) - + client = aerospike.client(self.config) client.apply(KEY, "query_apply", "mark_as_applied_one_arg", ["a"]) expect_records_to_have_user_key_stored(client, KEY[2]) + @pytest.mark.parametrize("set_key_option", ["batch_write"], indirect=True) def test_client_config_overrides_command_level_batch_write_policy(self): - config["policies"]["batch_write"] = { - "key": True - } - client = aerospike.client(config) + client = aerospike.client(self.config) ops = [ operations.write(BIN_NAME, "a") @@ -59,11 +72,9 @@ def test_client_config_overrides_command_level_batch_write_policy(self): expect_records_to_have_user_key_stored(client, KEY[2]) + @pytest.mark.parametrize("set_key_option", ["batch_apply"], indirect=True) def test_client_config_overrides_command_level_batch_apply_policy(self, connection_with_udf): - config["policies"]["batch_apply"] = { - "key": True - } - client = aerospike.client(config) + client = aerospike.client(self.config) client.batch_apply([KEY], "query_apply", "mark_as_applied_one_arg", ["a"]) From 4d42c30ad08d902fbf343c45575ffd1d4dfdff26 Mon Sep 17 00:00:00 2001 From: Julian Nguyen <109386615+juliannguyen4@users.noreply.github.com> Date: Thu, 16 Jul 2026 07:47:14 -0700 Subject: [PATCH 08/28] Address apply/batch apply test failures. Reuse more code from conftest --- test/new_tests/test_send_key_union_precedence.py | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/test/new_tests/test_send_key_union_precedence.py b/test/new_tests/test_send_key_union_precedence.py index e242dbfe85..c17a8fba05 100644 --- a/test/new_tests/test_send_key_union_precedence.py +++ b/test/new_tests/test_send_key_union_precedence.py @@ -1,7 +1,7 @@ import pytest from .test_base_class import TestBaseClass import aerospike -from .conftest import KEYS, BIN_NAME, expect_records_to_have_user_key_stored, AEROSPIKE_CLIENT_CONFIG_URL, DYN_CONFIG_PATH +from .conftest import KEYS, BIN_NAME, expect_records_to_have_user_key_stored, AEROSPIKE_CLIENT_CONFIG_URL, DYN_CONFIG_PATH, WRITE_OPS from aerospike_helpers.operations import operations import os @@ -44,14 +44,12 @@ def test_client_config_overrides_command_level_write_policy(self): def test_client_config_overrides_command_level_operate_policy(self): client = aerospike.client(self.config) - ops = [ - operations.write(BIN_NAME, "a") - ] + ops = WRITE_OPS client.operate(KEY, ops) expect_records_to_have_user_key_stored(client, KEY[2]) - udf_to_load = "example.lua" + udf_to_load = "query_apply.lua" @pytest.mark.parametrize("set_key_option", ["apply"], indirect=True) def test_client_config_overrides_command_level_apply_policy(self, connection_with_udf): From a2a96cd2deae0d91b561f0563503bdbc3e815ed5 Mon Sep 17 00:00:00 2001 From: Julian Nguyen <109386615+juliannguyen4@users.noreply.github.com> Date: Thu, 16 Jul 2026 09:09:47 -0700 Subject: [PATCH 09/28] Fix inaccurate comment.. --- test/new_tests/conftest.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/new_tests/conftest.py b/test/new_tests/conftest.py index 817987118b..0dce516ca9 100644 --- a/test/new_tests/conftest.py +++ b/test/new_tests/conftest.py @@ -300,7 +300,7 @@ def expect_records_to_have_user_key_stored(client: aerospike.Client, key: int | query = client.query("test", "demo") recs = query.results() - # Check that record key tuple has the primary key + # Check that record key tuple has the user key for record in recs: first_record_pk = record[0] assert first_record_pk[2] == key From 0d7b6bf7ea1ae06662865fda227eab36f20173a8 Mon Sep 17 00:00:00 2001 From: Julian Nguyen <109386615+juliannguyen4@users.noreply.github.com> Date: Thu, 16 Jul 2026 11:13:12 -0700 Subject: [PATCH 10/28] Address incorrect tests because command level policy will automatically inherit from config level policy options if the latter is not passed as an argument. --- test/new_tests/test_send_key_union_precedence.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/test/new_tests/test_send_key_union_precedence.py b/test/new_tests/test_send_key_union_precedence.py index c17a8fba05..06ebd77902 100644 --- a/test/new_tests/test_send_key_union_precedence.py +++ b/test/new_tests/test_send_key_union_precedence.py @@ -36,7 +36,7 @@ def set_key_option(self, request, override_dynamic_config: bool): def test_client_config_overrides_command_level_write_policy(self): client = aerospike.client(self.config) - client.put(KEY, bins={BIN_NAME: "a"}) + client.put(KEY, bins={BIN_NAME: "a"}, policy={"key": aerospike.POLICY_KEY_DIGEST}) expect_records_to_have_user_key_stored(client, KEY[2]) @@ -45,7 +45,7 @@ def test_client_config_overrides_command_level_operate_policy(self): client = aerospike.client(self.config) ops = WRITE_OPS - client.operate(KEY, ops) + client.operate(KEY, ops, policy={"key": aerospike.POLICY_KEY_DIGEST}) expect_records_to_have_user_key_stored(client, KEY[2]) @@ -55,7 +55,7 @@ def test_client_config_overrides_command_level_operate_policy(self): def test_client_config_overrides_command_level_apply_policy(self, connection_with_udf): client = aerospike.client(self.config) - client.apply(KEY, "query_apply", "mark_as_applied_one_arg", ["a"]) + client.apply(KEY, "query_apply", "mark_as_applied_one_arg", ["a"], policy={"key": aerospike.POLICY_KEY_DIGEST}) expect_records_to_have_user_key_stored(client, KEY[2]) @@ -66,7 +66,7 @@ def test_client_config_overrides_command_level_batch_write_policy(self): ops = [ operations.write(BIN_NAME, "a") ] - client.batch_operate([KEY], ops) + client.batch_operate([KEY], ops, policy_batch_write={"key": aerospike.POLICY_KEY_DIGEST}) expect_records_to_have_user_key_stored(client, KEY[2]) @@ -74,6 +74,6 @@ def test_client_config_overrides_command_level_batch_write_policy(self): def test_client_config_overrides_command_level_batch_apply_policy(self, connection_with_udf): client = aerospike.client(self.config) - client.batch_apply([KEY], "query_apply", "mark_as_applied_one_arg", ["a"]) + client.batch_apply([KEY], "query_apply", "mark_as_applied_one_arg", ["a"], policy_batch_apply={"key": aerospike.POLICY_KEY_DIGEST}) expect_records_to_have_user_key_stored(client, KEY[2]) From ea24ccfa51eceae6bc5116cca716218ddfd79685 Mon Sep 17 00:00:00 2001 From: Julian Nguyen <109386615+juliannguyen4@users.noreply.github.com> Date: Fri, 17 Jul 2026 07:13:09 -0700 Subject: [PATCH 11/28] Update C client to fix bug where the union of send key options is not applied when config level policy sends the key but command level policies overrides that option to false --- aerospike-client-c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/aerospike-client-c b/aerospike-client-c index bce75a68ad..c4870cfb84 160000 --- a/aerospike-client-c +++ b/aerospike-client-c @@ -1 +1 @@ -Subproject commit bce75a68adcce897c7e58168113bf928097fb0bd +Subproject commit c4870cfb8422fe6546afda3e9538e5a616356903 From 35a41f7f412da0f9026aabe8c5440ba66d568a01 Mon Sep 17 00:00:00 2001 From: Julian Nguyen <109386615+juliannguyen4@users.noreply.github.com> Date: Fri, 17 Jul 2026 08:26:04 -0700 Subject: [PATCH 12/28] Pull C client again to address test regressions --- aerospike-client-c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/aerospike-client-c b/aerospike-client-c index c4870cfb84..c1eccdcda2 160000 --- a/aerospike-client-c +++ b/aerospike-client-c @@ -1 +1 @@ -Subproject commit c4870cfb8422fe6546afda3e9538e5a616356903 +Subproject commit c1eccdcda215872c77a6a072f446a9780e3eacbf From a083de8e2c52cbc51dca6f85fcdfa33da146b172 Mon Sep 17 00:00:00 2001 From: Julian Nguyen <109386615+juliannguyen4@users.noreply.github.com> Date: Fri, 17 Jul 2026 12:37:30 -0700 Subject: [PATCH 13/28] Have expect_records_to_have_user_key_stored only expect presence of user key but not a specific value. only remove keys that were inserted during teardown --- test/new_tests/conftest.py | 14 +++++++++----- test/new_tests/test_dynamic_config.py | 2 +- test/new_tests/test_send_key_union_precedence.py | 10 +++++----- 3 files changed, 15 insertions(+), 11 deletions(-) diff --git a/test/new_tests/conftest.py b/test/new_tests/conftest.py index 0dce516ca9..f7fdbea2c4 100644 --- a/test/new_tests/conftest.py +++ b/test/new_tests/conftest.py @@ -284,7 +284,9 @@ def insert_records(request, as_connection): batch_records = [] brs = BatchRecords(batch_records=batch_records) - for i, key in enumerate(KEYS[:num_keys]): + KEYS_TO_INSERT = KEYS[:num_keys] + + for i, key in enumerate(KEYS_TO_INSERT): ops = [ operations.write(BIN_NAME, i), operations.write(MAP_BIN_NAME, {"a": i}) @@ -293,17 +295,19 @@ def insert_records(request, as_connection): batch_records.append(br) expected_number_bin_values.add(i) as_connection.batch_write(brs) + yield - as_connection.batch_remove(KEYS) -def expect_records_to_have_user_key_stored(client: aerospike.Client, key: int | str | bytearray): + as_connection.batch_remove(KEYS_TO_INSERT) + +def expect_records_to_have_user_key_stored(client: aerospike.Client): query = client.query("test", "demo") recs = query.results() # Check that record key tuple has the user key for record in recs: - first_record_pk = record[0] - assert first_record_pk[2] == key + pk = record[0] + assert pk[2] is not None BASIC_READ_BIN_OPS = [ operations.read(BIN_NAME) diff --git a/test/new_tests/test_dynamic_config.py b/test/new_tests/test_dynamic_config.py index fe10fc3ec6..8227b60da7 100644 --- a/test/new_tests/test_dynamic_config.py +++ b/test/new_tests/test_dynamic_config.py @@ -91,7 +91,7 @@ def test_dyn_config_file_works(self, functional_test_setup): # "Send key" is enabled in dynamic config # The key should be returned here - expect_records_to_have_user_key_stored(self.client, self.key[2]) + expect_records_to_have_user_key_stored(self.client) def test_enable_metrics_cannot_override_dyn_config(self, show_more_logs): config = TestBaseClass.get_connection_config() diff --git a/test/new_tests/test_send_key_union_precedence.py b/test/new_tests/test_send_key_union_precedence.py index 06ebd77902..1aa94d2741 100644 --- a/test/new_tests/test_send_key_union_precedence.py +++ b/test/new_tests/test_send_key_union_precedence.py @@ -38,7 +38,7 @@ def test_client_config_overrides_command_level_write_policy(self): client.put(KEY, bins={BIN_NAME: "a"}, policy={"key": aerospike.POLICY_KEY_DIGEST}) - expect_records_to_have_user_key_stored(client, KEY[2]) + expect_records_to_have_user_key_stored(client) @pytest.mark.parametrize("set_key_option", ["operate"], indirect=True) def test_client_config_overrides_command_level_operate_policy(self): @@ -47,7 +47,7 @@ def test_client_config_overrides_command_level_operate_policy(self): ops = WRITE_OPS client.operate(KEY, ops, policy={"key": aerospike.POLICY_KEY_DIGEST}) - expect_records_to_have_user_key_stored(client, KEY[2]) + expect_records_to_have_user_key_stored(client) udf_to_load = "query_apply.lua" @@ -57,7 +57,7 @@ def test_client_config_overrides_command_level_apply_policy(self, connection_wit client.apply(KEY, "query_apply", "mark_as_applied_one_arg", ["a"], policy={"key": aerospike.POLICY_KEY_DIGEST}) - expect_records_to_have_user_key_stored(client, KEY[2]) + expect_records_to_have_user_key_stored(client) @pytest.mark.parametrize("set_key_option", ["batch_write"], indirect=True) def test_client_config_overrides_command_level_batch_write_policy(self): @@ -68,7 +68,7 @@ def test_client_config_overrides_command_level_batch_write_policy(self): ] client.batch_operate([KEY], ops, policy_batch_write={"key": aerospike.POLICY_KEY_DIGEST}) - expect_records_to_have_user_key_stored(client, KEY[2]) + expect_records_to_have_user_key_stored(client) @pytest.mark.parametrize("set_key_option", ["batch_apply"], indirect=True) def test_client_config_overrides_command_level_batch_apply_policy(self, connection_with_udf): @@ -76,4 +76,4 @@ def test_client_config_overrides_command_level_batch_apply_policy(self, connecti client.batch_apply([KEY], "query_apply", "mark_as_applied_one_arg", ["a"], policy_batch_apply={"key": aerospike.POLICY_KEY_DIGEST}) - expect_records_to_have_user_key_stored(client, KEY[2]) + expect_records_to_have_user_key_stored(client) From 5785fec6a1dfea0ff6b6904efdd82058d57a6956 Mon Sep 17 00:00:00 2001 From: Julian Nguyen <109386615+juliannguyen4@users.noreply.github.com> Date: Fri, 17 Jul 2026 13:40:33 -0700 Subject: [PATCH 14/28] Add ability to make each test case in new_tests/test_send_key_union_precedence.py use a unique set name. This makes sure each test case performs a query that cannot pick up leftover keys from previous tests. --- test/new_tests/conftest.py | 21 ++++++++++++------- test/new_tests/string_helpers.py | 3 --- test/new_tests/test_exception_subcode.py | 8 +++---- .../test_query_execute_background.py | 5 +++++ .../test_send_key_union_precedence.py | 17 +++++++-------- 5 files changed, 29 insertions(+), 25 deletions(-) diff --git a/test/new_tests/conftest.py b/test/new_tests/conftest.py index f7fdbea2c4..2e3f355287 100644 --- a/test/new_tests/conftest.py +++ b/test/new_tests/conftest.py @@ -270,23 +270,27 @@ def wait_for_job_completion(as_connection, job_id, job_module: int = aerospike.J BIN_NAME = "number" MAP_BIN_NAME = "map" -# TODO: scale down tests maybe -KEYS = [(TEST_NS, TEST_SET, i) for i in range(500)] expected_number_bin_values = set() # Add records around the test @pytest.fixture(scope="function") def insert_records(request, as_connection): - if hasattr(request, "param") and isinstance(request.param, int): - num_keys = request.param + + num_keys, make_set_unique = request.param + + if make_set_unique: + unique_set = f"{TEST_SET}-{time.time()}" + request.cls.unique_set = unique_set else: - num_keys = len(KEYS) + unique_set = TEST_SET + + keys = [(TEST_NS, unique_set, i) for i in range(num_keys)] + request.cls.keys = keys batch_records = [] brs = BatchRecords(batch_records=batch_records) - KEYS_TO_INSERT = KEYS[:num_keys] - for i, key in enumerate(KEYS_TO_INSERT): + for i, key in enumerate(keys): ops = [ operations.write(BIN_NAME, i), operations.write(MAP_BIN_NAME, {"a": i}) @@ -294,11 +298,12 @@ def insert_records(request, as_connection): br = Write(key, ops=ops) batch_records.append(br) expected_number_bin_values.add(i) + as_connection.batch_write(brs) yield - as_connection.batch_remove(KEYS_TO_INSERT) + as_connection.batch_remove(keys) def expect_records_to_have_user_key_stored(client: aerospike.Client): query = client.query("test", "demo") diff --git a/test/new_tests/string_helpers.py b/test/new_tests/string_helpers.py index 1cef3d127c..c31ab9e886 100644 --- a/test/new_tests/string_helpers.py +++ b/test/new_tests/string_helpers.py @@ -1,11 +1,8 @@ -from .conftest import KEYS import unicodedata import pytest from aerospike_helpers.string_helpers import StringPolicy -KEY = KEYS[0] - NON_STR_BIN_NAME = INT_BIN_NAME = "nonstr" STR_BIN_NAME = "str" DOUBLE_BIN_NAME = "double" diff --git a/test/new_tests/test_exception_subcode.py b/test/new_tests/test_exception_subcode.py index ec3fe62c3e..9cae295823 100644 --- a/test/new_tests/test_exception_subcode.py +++ b/test/new_tests/test_exception_subcode.py @@ -1,5 +1,5 @@ import pytest -from .conftest import KEYS, BIN_NAME +from .conftest import TEST_NS, TEST_SET, BIN_NAME import aerospike from aerospike import exception as e from aerospike_helpers.operations import list_operations as list_ops @@ -7,7 +7,7 @@ from . import as_errors -KEY = KEYS[0] +KEY = (TEST_NS, TEST_SET, 1) OPS = [ list_ops.list_get_by_index(BIN_NAME, index=99, return_type=aerospike.LIST_RETURN_VALUE) ] @@ -49,7 +49,7 @@ def test_error_verbosity_levels(self, policy_w_verbosity_setting: dict, set_in_c if not set_in_client_config: cmd_policy |= policy_w_verbosity_setting - self.as_connection.operate(KEYS[0], OPS, policy=cmd_policy) + self.as_connection.operate(KEY, OPS, policy=cmd_policy) # Make sure there's no regression with the parent error code assert excinfo.value.code == as_errors.AEROSPIKE_ERR_OP_NOT_APPLICABLE @@ -83,4 +83,4 @@ def test_invalid_verbosity(self): ERROR_DETAIL_VERBOSITY_SETTING: 3 } with pytest.raises(e.ServerError): - self.as_connection.operate(KEYS[0], OPS, policy=policy) + self.as_connection.operate(KEY, OPS, policy=policy) diff --git a/test/new_tests/test_query_execute_background.py b/test/new_tests/test_query_execute_background.py index 6df02ce75f..270134adad 100644 --- a/test/new_tests/test_query_execute_background.py +++ b/test/new_tests/test_query_execute_background.py @@ -41,6 +41,11 @@ def validate_records(client, keys, validator): +@pytest.mark.parametrize( + "insert_records", + [[500, False]], + indirect=True +) class TestQueryApply(object): # These functions will run once for this test class, and do all of the diff --git a/test/new_tests/test_send_key_union_precedence.py b/test/new_tests/test_send_key_union_precedence.py index 1aa94d2741..cd3e7789d9 100644 --- a/test/new_tests/test_send_key_union_precedence.py +++ b/test/new_tests/test_send_key_union_precedence.py @@ -1,17 +1,14 @@ import pytest from .test_base_class import TestBaseClass import aerospike -from .conftest import KEYS, BIN_NAME, expect_records_to_have_user_key_stored, AEROSPIKE_CLIENT_CONFIG_URL, DYN_CONFIG_PATH, WRITE_OPS +from .conftest import TEST_NS, TEST_SET, BIN_NAME, expect_records_to_have_user_key_stored, AEROSPIKE_CLIENT_CONFIG_URL, DYN_CONFIG_PATH, WRITE_OPS from aerospike_helpers.operations import operations import os -KEY = KEYS[0] - - @pytest.mark.parametrize( "insert_records", - [1], + [[1, True]], indirect=True ) @pytest.mark.usefixtures("insert_records") @@ -36,7 +33,7 @@ def set_key_option(self, request, override_dynamic_config: bool): def test_client_config_overrides_command_level_write_policy(self): client = aerospike.client(self.config) - client.put(KEY, bins={BIN_NAME: "a"}, policy={"key": aerospike.POLICY_KEY_DIGEST}) + client.put(self.keys[0], bins={BIN_NAME: "a"}, policy={"key": aerospike.POLICY_KEY_DIGEST}) expect_records_to_have_user_key_stored(client) @@ -45,7 +42,7 @@ def test_client_config_overrides_command_level_operate_policy(self): client = aerospike.client(self.config) ops = WRITE_OPS - client.operate(KEY, ops, policy={"key": aerospike.POLICY_KEY_DIGEST}) + client.operate(self.keys[0], ops, policy={"key": aerospike.POLICY_KEY_DIGEST}) expect_records_to_have_user_key_stored(client) @@ -55,7 +52,7 @@ def test_client_config_overrides_command_level_operate_policy(self): def test_client_config_overrides_command_level_apply_policy(self, connection_with_udf): client = aerospike.client(self.config) - client.apply(KEY, "query_apply", "mark_as_applied_one_arg", ["a"], policy={"key": aerospike.POLICY_KEY_DIGEST}) + client.apply(self.keys[0], "query_apply", "mark_as_applied_one_arg", ["a"], policy={"key": aerospike.POLICY_KEY_DIGEST}) expect_records_to_have_user_key_stored(client) @@ -66,7 +63,7 @@ def test_client_config_overrides_command_level_batch_write_policy(self): ops = [ operations.write(BIN_NAME, "a") ] - client.batch_operate([KEY], ops, policy_batch_write={"key": aerospike.POLICY_KEY_DIGEST}) + client.batch_operate([self.keys[0]], ops, policy_batch_write={"key": aerospike.POLICY_KEY_DIGEST}) expect_records_to_have_user_key_stored(client) @@ -74,6 +71,6 @@ def test_client_config_overrides_command_level_batch_write_policy(self): def test_client_config_overrides_command_level_batch_apply_policy(self, connection_with_udf): client = aerospike.client(self.config) - client.batch_apply([KEY], "query_apply", "mark_as_applied_one_arg", ["a"], policy_batch_apply={"key": aerospike.POLICY_KEY_DIGEST}) + client.batch_apply([self.keys[0]], "query_apply", "mark_as_applied_one_arg", ["a"], policy_batch_apply={"key": aerospike.POLICY_KEY_DIGEST}) expect_records_to_have_user_key_stored(client) From e433abad38f0adeedbe1daab3984bcadd41ce4cb Mon Sep 17 00:00:00 2001 From: Julian Nguyen <109386615+juliannguyen4@users.noreply.github.com> Date: Fri, 17 Jul 2026 14:39:54 -0700 Subject: [PATCH 15/28] Address test syntax errors. --- test/new_tests/test_expressions_string.py | 1 + test/new_tests/test_string_operations.py | 1 + 2 files changed, 2 insertions(+) diff --git a/test/new_tests/test_expressions_string.py b/test/new_tests/test_expressions_string.py index f2c7d8d7c8..5f7492ede1 100644 --- a/test/new_tests/test_expressions_string.py +++ b/test/new_tests/test_expressions_string.py @@ -10,6 +10,7 @@ from .test_base_class import TestBaseClass from .string_helpers import * from .conftest import expect_server_version_earlier_than_8_1_3_to_fail +KEY = ("test", "demo", 1) class TestExpressions: diff --git a/test/new_tests/test_string_operations.py b/test/new_tests/test_string_operations.py index 3ac4042e9f..5fcbb9de62 100644 --- a/test/new_tests/test_string_operations.py +++ b/test/new_tests/test_string_operations.py @@ -10,6 +10,7 @@ from .conftest import expect_server_version_earlier_than_8_1_3_to_fail from .test_base_class import TestBaseClass from .string_helpers import * +KEY = ("test", "demo", 1) class TestStringOperations: From 811c8e3fbad89029cc2cf6f230a5c92eea5456da Mon Sep 17 00:00:00 2001 From: Julian Nguyen <109386615+juliannguyen4@users.noreply.github.com> Date: Fri, 17 Jul 2026 14:58:18 -0700 Subject: [PATCH 16/28] Try passing parameters indirectly to insert_records fixture to address test errors. --- test/new_tests/test_query_bin_projection.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/test/new_tests/test_query_bin_projection.py b/test/new_tests/test_query_bin_projection.py index 5d7a94bd78..068d9bc853 100644 --- a/test/new_tests/test_query_bin_projection.py +++ b/test/new_tests/test_query_bin_projection.py @@ -17,6 +17,12 @@ class TestQueryBinProjection: aerospike.Client.query ], indirect=True + ), + pytest.mark.parametrize( + "insert_records", + [ + [500, False] + ] ) ] From ae7099b3db20dcf27abb8afd09edbfc29024ce9c Mon Sep 17 00:00:00 2001 From: Julian Nguyen <109386615+juliannguyen4@users.noreply.github.com> Date: Mon, 20 Jul 2026 08:44:18 -0700 Subject: [PATCH 17/28] Document why make_set_unique is a fixture param. Add missing indirect flag --- test/new_tests/conftest.py | 2 ++ test/new_tests/test_query_bin_projection.py | 3 ++- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/test/new_tests/conftest.py b/test/new_tests/conftest.py index 2e3f355287..67e0cc9981 100644 --- a/test/new_tests/conftest.py +++ b/test/new_tests/conftest.py @@ -276,6 +276,8 @@ def wait_for_job_completion(as_connection, job_id, job_module: int = aerospike.J @pytest.fixture(scope="function") def insert_records(request, as_connection): + # Some tests don't make use of unique sets, + # so we leave this alone for backwards compatibility num_keys, make_set_unique = request.param if make_set_unique: diff --git a/test/new_tests/test_query_bin_projection.py b/test/new_tests/test_query_bin_projection.py index 068d9bc853..a99a380e63 100644 --- a/test/new_tests/test_query_bin_projection.py +++ b/test/new_tests/test_query_bin_projection.py @@ -22,7 +22,8 @@ class TestQueryBinProjection: "insert_records", [ [500, False] - ] + ], + indirect=True ) ] From 9516daf6b03209bd7e1129a52eb277ea751d35f6 Mon Sep 17 00:00:00 2001 From: Julian Nguyen <109386615+juliannguyen4@users.noreply.github.com> Date: Mon, 20 Jul 2026 08:47:04 -0700 Subject: [PATCH 18/28] Clarify what make_set_unique is for. --- test/new_tests/conftest.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/test/new_tests/conftest.py b/test/new_tests/conftest.py index 67e0cc9981..c895c8d18c 100644 --- a/test/new_tests/conftest.py +++ b/test/new_tests/conftest.py @@ -276,8 +276,11 @@ def wait_for_job_completion(as_connection, job_id, job_module: int = aerospike.J @pytest.fixture(scope="function") def insert_records(request, as_connection): - # Some tests don't make use of unique sets, + # - Some tests don't make use of unique sets, # so we leave this alone for backwards compatibility + # - make_set_unique ensures that if a test case's cleanup stage fails to run + # e.g when the test case's setup fixture fails out, + # that test case's records does not interfere with future test cases that need to perform a query num_keys, make_set_unique = request.param if make_set_unique: From 6a193f22ab5a958e53ce7552352bc478caec58d4 Mon Sep 17 00:00:00 2001 From: Julian Nguyen <109386615+juliannguyen4@users.noreply.github.com> Date: Mon, 20 Jul 2026 08:47:52 -0700 Subject: [PATCH 19/28] Clear up confusing comment.. --- test/new_tests/conftest.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/new_tests/conftest.py b/test/new_tests/conftest.py index c895c8d18c..5539ad4e4a 100644 --- a/test/new_tests/conftest.py +++ b/test/new_tests/conftest.py @@ -277,7 +277,7 @@ def wait_for_job_completion(as_connection, job_id, job_module: int = aerospike.J def insert_records(request, as_connection): # - Some tests don't make use of unique sets, - # so we leave this alone for backwards compatibility + # so we leave them alone for backwards compatibility # - make_set_unique ensures that if a test case's cleanup stage fails to run # e.g when the test case's setup fixture fails out, # that test case's records does not interfere with future test cases that need to perform a query From ddd5079a45fa0832ba0bd99b60c14231143ce15b Mon Sep 17 00:00:00 2001 From: Julian Nguyen <109386615+juliannguyen4@users.noreply.github.com> Date: Mon, 20 Jul 2026 08:48:51 -0700 Subject: [PATCH 20/28] Make var naming less confusing --- test/new_tests/conftest.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/test/new_tests/conftest.py b/test/new_tests/conftest.py index 5539ad4e4a..9b5d5b1582 100644 --- a/test/new_tests/conftest.py +++ b/test/new_tests/conftest.py @@ -284,12 +284,12 @@ def insert_records(request, as_connection): num_keys, make_set_unique = request.param if make_set_unique: - unique_set = f"{TEST_SET}-{time.time()}" - request.cls.unique_set = unique_set + set_name = f"{TEST_SET}-{time.time()}" + request.cls.unique_set = set_name else: - unique_set = TEST_SET + set_name = TEST_SET - keys = [(TEST_NS, unique_set, i) for i in range(num_keys)] + keys = [(TEST_NS, set_name, i) for i in range(num_keys)] request.cls.keys = keys batch_records = [] From ba0e46d225697468be91ad595836d4cdd6b548fc Mon Sep 17 00:00:00 2001 From: Julian Nguyen <109386615+juliannguyen4@users.noreply.github.com> Date: Mon, 20 Jul 2026 08:54:48 -0700 Subject: [PATCH 21/28] Fix test bug that only runs query against demo instead of the unique set defined for each test case. --- test/new_tests/conftest.py | 6 +++--- test/new_tests/test_dynamic_config.py | 2 +- test/new_tests/test_send_key_union_precedence.py | 10 +++++----- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/test/new_tests/conftest.py b/test/new_tests/conftest.py index 9b5d5b1582..74cb75c93c 100644 --- a/test/new_tests/conftest.py +++ b/test/new_tests/conftest.py @@ -285,10 +285,10 @@ def insert_records(request, as_connection): if make_set_unique: set_name = f"{TEST_SET}-{time.time()}" - request.cls.unique_set = set_name else: set_name = TEST_SET + request.cls.set_name = set_name keys = [(TEST_NS, set_name, i) for i in range(num_keys)] request.cls.keys = keys @@ -310,8 +310,8 @@ def insert_records(request, as_connection): as_connection.batch_remove(keys) -def expect_records_to_have_user_key_stored(client: aerospike.Client): - query = client.query("test", "demo") +def expect_records_to_have_user_key_stored(client: aerospike.Client, set_name: str): + query = client.query(TEST_NS, set_name) recs = query.results() # Check that record key tuple has the user key diff --git a/test/new_tests/test_dynamic_config.py b/test/new_tests/test_dynamic_config.py index 8227b60da7..5703186421 100644 --- a/test/new_tests/test_dynamic_config.py +++ b/test/new_tests/test_dynamic_config.py @@ -91,7 +91,7 @@ def test_dyn_config_file_works(self, functional_test_setup): # "Send key" is enabled in dynamic config # The key should be returned here - expect_records_to_have_user_key_stored(self.client) + expect_records_to_have_user_key_stored(self.client, set_name="demo") def test_enable_metrics_cannot_override_dyn_config(self, show_more_logs): config = TestBaseClass.get_connection_config() diff --git a/test/new_tests/test_send_key_union_precedence.py b/test/new_tests/test_send_key_union_precedence.py index cd3e7789d9..1ed2f16129 100644 --- a/test/new_tests/test_send_key_union_precedence.py +++ b/test/new_tests/test_send_key_union_precedence.py @@ -35,7 +35,7 @@ def test_client_config_overrides_command_level_write_policy(self): client.put(self.keys[0], bins={BIN_NAME: "a"}, policy={"key": aerospike.POLICY_KEY_DIGEST}) - expect_records_to_have_user_key_stored(client) + expect_records_to_have_user_key_stored(client, self.set_name) @pytest.mark.parametrize("set_key_option", ["operate"], indirect=True) def test_client_config_overrides_command_level_operate_policy(self): @@ -44,7 +44,7 @@ def test_client_config_overrides_command_level_operate_policy(self): ops = WRITE_OPS client.operate(self.keys[0], ops, policy={"key": aerospike.POLICY_KEY_DIGEST}) - expect_records_to_have_user_key_stored(client) + expect_records_to_have_user_key_stored(client, self.set_name) udf_to_load = "query_apply.lua" @@ -54,7 +54,7 @@ def test_client_config_overrides_command_level_apply_policy(self, connection_wit client.apply(self.keys[0], "query_apply", "mark_as_applied_one_arg", ["a"], policy={"key": aerospike.POLICY_KEY_DIGEST}) - expect_records_to_have_user_key_stored(client) + expect_records_to_have_user_key_stored(client, self.set_name) @pytest.mark.parametrize("set_key_option", ["batch_write"], indirect=True) def test_client_config_overrides_command_level_batch_write_policy(self): @@ -65,7 +65,7 @@ def test_client_config_overrides_command_level_batch_write_policy(self): ] client.batch_operate([self.keys[0]], ops, policy_batch_write={"key": aerospike.POLICY_KEY_DIGEST}) - expect_records_to_have_user_key_stored(client) + expect_records_to_have_user_key_stored(client, self.set_name) @pytest.mark.parametrize("set_key_option", ["batch_apply"], indirect=True) def test_client_config_overrides_command_level_batch_apply_policy(self, connection_with_udf): @@ -73,4 +73,4 @@ def test_client_config_overrides_command_level_batch_apply_policy(self, connecti client.batch_apply([self.keys[0]], "query_apply", "mark_as_applied_one_arg", ["a"], policy_batch_apply={"key": aerospike.POLICY_KEY_DIGEST}) - expect_records_to_have_user_key_stored(client) + expect_records_to_have_user_key_stored(client, self.set_name) From 84a20c477cd6439ab2090b79274b6317f0ceb5d3 Mon Sep 17 00:00:00 2001 From: Julian Nguyen <109386615+juliannguyen4@users.noreply.github.com> Date: Mon, 20 Jul 2026 09:57:31 -0700 Subject: [PATCH 22/28] Only test policies supported by dynamic config. This removes policies that aren't declared in the dynamic config's yaml schema and addresses the warnings reported in the client logs re: this. --- test/dyn_config.yml | 4 +--- .../test_send_key_union_precedence.py | 20 +++++++++---------- 2 files changed, 11 insertions(+), 13 deletions(-) diff --git a/test/dyn_config.yml b/test/dyn_config.yml index aaff923d83..b1deaf206c 100644 --- a/test/dyn_config.yml +++ b/test/dyn_config.yml @@ -4,13 +4,11 @@ dynamic: enable: true write: send_key: true - apply: - send_key: true operate: send_key: true batch_write: send_key: true - batch_apply: + batch_udf: send_key: true static: client: diff --git a/test/new_tests/test_send_key_union_precedence.py b/test/new_tests/test_send_key_union_precedence.py index 1ed2f16129..ad624451ee 100644 --- a/test/new_tests/test_send_key_union_precedence.py +++ b/test/new_tests/test_send_key_union_precedence.py @@ -12,24 +12,24 @@ indirect=True ) @pytest.mark.usefixtures("insert_records") -@pytest.mark.parametrize("override_dynamic_config", [False, True]) class TestSendKeyUnionPrecedence: @pytest.fixture(autouse=True) - def set_key_option(self, request, override_dynamic_config: bool): + def set_key_option(self, request): self.config = TestBaseClass.get_connection_config() + policy_name, override_dynamic_config = request.param if override_dynamic_config: os.environ[AEROSPIKE_CLIENT_CONFIG_URL] = DYN_CONFIG_PATH else: - if request.param not in self.config["policies"]: - self.config["policies"][request.param] = {} - self.config["policies"][request.param]["key"] = True + if policy_name not in self.config["policies"]: + self.config["policies"][policy_name] = {} + self.config["policies"][policy_name]["key"] = True yield if override_dynamic_config: del os.environ[AEROSPIKE_CLIENT_CONFIG_URL] - @pytest.mark.parametrize("set_key_option", ["write"], indirect=True) + @pytest.mark.parametrize("set_key_option", [("write", False), ("write", True)], indirect=True) def test_client_config_overrides_command_level_write_policy(self): client = aerospike.client(self.config) @@ -37,7 +37,7 @@ def test_client_config_overrides_command_level_write_policy(self): expect_records_to_have_user_key_stored(client, self.set_name) - @pytest.mark.parametrize("set_key_option", ["operate"], indirect=True) + @pytest.mark.parametrize("set_key_option", [("operate", False)], indirect=True) def test_client_config_overrides_command_level_operate_policy(self): client = aerospike.client(self.config) @@ -48,7 +48,7 @@ def test_client_config_overrides_command_level_operate_policy(self): udf_to_load = "query_apply.lua" - @pytest.mark.parametrize("set_key_option", ["apply"], indirect=True) + @pytest.mark.parametrize("set_key_option", [("apply", False)], indirect=True) def test_client_config_overrides_command_level_apply_policy(self, connection_with_udf): client = aerospike.client(self.config) @@ -56,7 +56,7 @@ def test_client_config_overrides_command_level_apply_policy(self, connection_wit expect_records_to_have_user_key_stored(client, self.set_name) - @pytest.mark.parametrize("set_key_option", ["batch_write"], indirect=True) + @pytest.mark.parametrize("set_key_option", [("batch_write", False), ("batch_write", True)], indirect=True) def test_client_config_overrides_command_level_batch_write_policy(self): client = aerospike.client(self.config) @@ -67,7 +67,7 @@ def test_client_config_overrides_command_level_batch_write_policy(self): expect_records_to_have_user_key_stored(client, self.set_name) - @pytest.mark.parametrize("set_key_option", ["batch_apply"], indirect=True) + @pytest.mark.parametrize("set_key_option", [("batch_apply", False)], indirect=True) def test_client_config_overrides_command_level_batch_apply_policy(self, connection_with_udf): client = aerospike.client(self.config) From 4312ed9688582918df8dcd0dcd2256e61c0b53fd Mon Sep 17 00:00:00 2001 From: Julian Nguyen <109386615+juliannguyen4@users.noreply.github.com> Date: Mon, 20 Jul 2026 10:04:39 -0700 Subject: [PATCH 23/28] use time.time_ns() to generate set name instead because time.time() uses invalid chars for set names. --- test/new_tests/conftest.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/new_tests/conftest.py b/test/new_tests/conftest.py index 74cb75c93c..634b37f8f5 100644 --- a/test/new_tests/conftest.py +++ b/test/new_tests/conftest.py @@ -284,7 +284,7 @@ def insert_records(request, as_connection): num_keys, make_set_unique = request.param if make_set_unique: - set_name = f"{TEST_SET}-{time.time()}" + set_name = f"{TEST_SET}-{time.time_ns()}" else: set_name = TEST_SET From 9b5f72f266fc50f93d13664c1f8191b4776d4a22 Mon Sep 17 00:00:00 2001 From: Julian Nguyen <109386615+juliannguyen4@users.noreply.github.com> Date: Mon, 20 Jul 2026 10:24:57 -0700 Subject: [PATCH 24/28] Only clean up test side effects if make_set_unique is false. This way the side effects can be inspected after a test run that uses a unique set name --- test/new_tests/conftest.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/test/new_tests/conftest.py b/test/new_tests/conftest.py index 634b37f8f5..10f25c1d65 100644 --- a/test/new_tests/conftest.py +++ b/test/new_tests/conftest.py @@ -308,7 +308,8 @@ def insert_records(request, as_connection): yield - as_connection.batch_remove(keys) + if make_set_unique is False: + as_connection.batch_remove(keys) def expect_records_to_have_user_key_stored(client: aerospike.Client, set_name: str): query = client.query(TEST_NS, set_name) From bed12e55c265a712cc021407d44524a7db24c492 Mon Sep 17 00:00:00 2001 From: Julian Nguyen <109386615+juliannguyen4@users.noreply.github.com> Date: Mon, 20 Jul 2026 11:47:45 -0700 Subject: [PATCH 25/28] Forgot to remove operate.send_key from dyn_config.yml, which is also invalid --- test/dyn_config.yml | 2 -- 1 file changed, 2 deletions(-) diff --git a/test/dyn_config.yml b/test/dyn_config.yml index b1deaf206c..b6824e5eb3 100644 --- a/test/dyn_config.yml +++ b/test/dyn_config.yml @@ -4,8 +4,6 @@ dynamic: enable: true write: send_key: true - operate: - send_key: true batch_write: send_key: true batch_udf: From 5698cea19caf803f6e1f256a9697f087dec96285 Mon Sep 17 00:00:00 2001 From: Julian Nguyen <109386615+juliannguyen4@users.noreply.github.com> Date: Mon, 20 Jul 2026 12:13:35 -0700 Subject: [PATCH 26/28] Pull Brian's fix to address the remaining batch_write and batch_apply test case failures. --- .gitmodules | 2 +- aerospike-client-c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.gitmodules b/.gitmodules index 136ba68cbe..5414041bb2 100644 --- a/.gitmodules +++ b/.gitmodules @@ -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 = jnguyen/tmp-test-batch_write-policy-union-behavior diff --git a/aerospike-client-c b/aerospike-client-c index c1eccdcda2..1889a204c4 160000 --- a/aerospike-client-c +++ b/aerospike-client-c @@ -1 +1 @@ -Subproject commit c1eccdcda215872c77a6a072f446a9780e3eacbf +Subproject commit 1889a204c468d2b358328807dd4e2ba49c2aa818 From 87f31937aceb33aec6e2c9f998f22d24bc08c646 Mon Sep 17 00:00:00 2001 From: Julian Nguyen <109386615+juliannguyen4@users.noreply.github.com> Date: Mon, 20 Jul 2026 13:36:01 -0700 Subject: [PATCH 27/28] Point C client back to stage with Brian's fix now merged into there --- .gitmodules | 2 +- aerospike-client-c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.gitmodules b/.gitmodules index 5414041bb2..136ba68cbe 100644 --- a/.gitmodules +++ b/.gitmodules @@ -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 = jnguyen/tmp-test-batch_write-policy-union-behavior + branch = stage diff --git a/aerospike-client-c b/aerospike-client-c index 1889a204c4..53f245112d 160000 --- a/aerospike-client-c +++ b/aerospike-client-c @@ -1 +1 @@ -Subproject commit 1889a204c468d2b358328807dd4e2ba49c2aa818 +Subproject commit 53f245112dc64282978fe0b510e84cebacf65131 From 0ade5c65582038c9e634990596b09a6211a441dd Mon Sep 17 00:00:00 2001 From: Julian Nguyen <109386615+juliannguyen4@users.noreply.github.com> Date: Mon, 20 Jul 2026 14:29:59 -0700 Subject: [PATCH 28/28] Reduce use of hardcoded strings --- test/new_tests/test_command_level_policies.py | 4 ++-- test/new_tests/test_expressions_string.py | 4 ++-- test/new_tests/test_string_operations.py | 5 ++--- 3 files changed, 6 insertions(+), 7 deletions(-) diff --git a/test/new_tests/test_command_level_policies.py b/test/new_tests/test_command_level_policies.py index d997d3aa17..51552f9bf8 100644 --- a/test/new_tests/test_command_level_policies.py +++ b/test/new_tests/test_command_level_policies.py @@ -6,10 +6,10 @@ from aerospike_helpers.batch import records as br from .test_base_class import TestBaseClass from aerospike_helpers.operations import operations -from .conftest import verify_record_ttl +from .conftest import verify_record_ttl, TEST_NS, TEST_SET SKIP_MSG = "read_touch_ttl_percent only supported on server 7.1 or higher" -KEY = ("test", "demo", 1) +KEY = (TEST_NS, TEST_SET, 1) @pytest.mark.usefixtures("as_connection") diff --git a/test/new_tests/test_expressions_string.py b/test/new_tests/test_expressions_string.py index 5f7492ede1..e967a417e0 100644 --- a/test/new_tests/test_expressions_string.py +++ b/test/new_tests/test_expressions_string.py @@ -9,8 +9,8 @@ from .test_base_class import TestBaseClass from .string_helpers import * -from .conftest import expect_server_version_earlier_than_8_1_3_to_fail -KEY = ("test", "demo", 1) +from .conftest import expect_server_version_earlier_than_8_1_3_to_fail, TEST_NS, TEST_SET +KEY = (TEST_NS, TEST_SET, 1) class TestExpressions: diff --git a/test/new_tests/test_string_operations.py b/test/new_tests/test_string_operations.py index 5fcbb9de62..66840d7e11 100644 --- a/test/new_tests/test_string_operations.py +++ b/test/new_tests/test_string_operations.py @@ -7,10 +7,9 @@ from aerospike import exception as e from aerospike_helpers import cdt_ctx -from .conftest import expect_server_version_earlier_than_8_1_3_to_fail -from .test_base_class import TestBaseClass +from .conftest import expect_server_version_earlier_than_8_1_3_to_fail, TEST_NS, TEST_SET from .string_helpers import * -KEY = ("test", "demo", 1) +KEY = (TEST_NS, TEST_SET, 1) class TestStringOperations: