From 9b5874d5da31f4dfd09b08c2a378c9b966cf2eae Mon Sep 17 00:00:00 2001 From: "Chayim I. Kirshen" Date: Wed, 2 Mar 2022 14:48:02 +0200 Subject: [PATCH 1/3] redis dependencies to get to 4.1.4 --- opt/system-setup.py | 2 -- tests/flow/tests_setup/test_requirements.txt | 7 +++---- 2 files changed, 3 insertions(+), 6 deletions(-) diff --git a/opt/system-setup.py b/opt/system-setup.py index 448b5c421..136c05736 100755 --- a/opt/system-setup.py +++ b/opt/system-setup.py @@ -71,8 +71,6 @@ def common_last(self): else: self.run("%s/bin/getcmake" % READIES) - self.run("{PYTHON} {READIES}/bin/getrmpytools".format(PYTHON=self.python, READIES=READIES)) - self.pip_install("-r %s/tests/flow/tests_setup/test_requirements.txt" % ROOT) self.pip_install("awscli") diff --git a/tests/flow/tests_setup/test_requirements.txt b/tests/flow/tests_setup/test_requirements.txt index ff32e9c10..0ccad5578 100644 --- a/tests/flow/tests_setup/test_requirements.txt +++ b/tests/flow/tests_setup/test_requirements.txt @@ -1,7 +1,6 @@ numpy>=1.19 scikit-image -redis-py-cluster redisai -redis>=3.0.0 -git+https://github.com/Grokzen/redis-py-cluster.git@master -git+https://github.com/RedisLabsModules/RLTest.git@master \ No newline at end of file +redis>=4.1.4 +rltest>=0.5.0 +ramp-packer>=2.3.0 From ffd5931211f12b3cfbef3cd8b24385e7b3731061 Mon Sep 17 00:00:00 2001 From: DvirDukhan Date: Sun, 6 Mar 2022 12:16:56 +0200 Subject: [PATCH 2/3] wip --- tests/flow/includes.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/flow/includes.py b/tests/flow/includes.py index 354761833..76f66c504 100755 --- a/tests/flow/includes.py +++ b/tests/flow/includes.py @@ -253,4 +253,4 @@ def get_info_section(con, section): def get_connection(env, routing_hint): - return env.getConnectionByKey(routing_hint, None) + return env.getConnectionByKey(routing_hint, 'SET') From 2188b43672851ce288236fef015a57ddf5b61d9c Mon Sep 17 00:00:00 2001 From: DvirDukhan Date: Sun, 6 Mar 2022 13:27:04 +0200 Subject: [PATCH 3/3] adapt changes to new redis-py errors --- tests/flow/includes.py | 10 +++++----- tests/flow/tests_commands.py | 12 ++++++------ tests/flow/tests_dag_errors.py | 6 +++--- 3 files changed, 14 insertions(+), 14 deletions(-) diff --git a/tests/flow/includes.py b/tests/flow/includes.py index 76f66c504..c5286d875 100755 --- a/tests/flow/includes.py +++ b/tests/flow/includes.py @@ -202,7 +202,7 @@ def run_test_multiproc(env, routing_hint, n_procs, fn, args=tuple()): procs = [] def tmpfn(): - con = env.getConnectionByKey(routing_hint, None) + con = env.getConnectionByKey(routing_hint, 'SET') fn(con, *args) return 1 @@ -222,12 +222,12 @@ def load_file_content(file_name): return f.read() -def check_error_message(env, con, error_msg, *command, error_msg_is_substr=False): +def check_error_message(env, con, error_msg, *command, error_msg_is_substr=False, error_type=redis.exceptions.ResponseError): try: con.execute_command(*command) env.assertFalse(True, message=get_caller_pos()) except Exception as exception: - env.assertEqual(type(exception), redis.exceptions.ResponseError, message=get_caller_pos()) + env.assertEqual(type(exception), error_type, message=get_caller_pos()) if error_msg_is_substr: # We only verify that the given error_msg is a substring of the entire error message. env.assertTrue(str(exception).find(error_msg) >= 0, message=get_caller_pos()) @@ -235,13 +235,13 @@ def check_error_message(env, con, error_msg, *command, error_msg_is_substr=False env.assertEqual(error_msg, str(exception), message=get_caller_pos()) -def check_error(env, con, *command): +def check_error(env, con, *command, error_type=redis.exceptions.ResponseError): try: con.execute_command(*command) env.assertFalse(True, message=get_caller_pos()) except Exception as e: exception = e - env.assertEqual(type(exception), redis.exceptions.ResponseError, message=get_caller_pos()) + env.assertTrue(issubclass(type(exception), error_type), message=get_caller_pos()) # Returns a dict with all the fields of a certain section from INFO MODULES command diff --git a/tests/flow/tests_commands.py b/tests/flow/tests_commands.py index 7d21da8b4..251a0c9d9 100644 --- a/tests/flow/tests_commands.py +++ b/tests/flow/tests_commands.py @@ -147,10 +147,10 @@ def test_modelexecute_errors(env): # The following 2 commands should raise an error on cluster mode (keys are not on the same shard) if env.isCluster(): - check_error_message(env, con, "CROSSSLOT Keys in request don't hash to the same slot", - 'AI.MODELEXECUTE', 'm{1}', 'INPUTS', 2, 'a{1}', 'b', 'OUTPUTS', 1, 'c{1}') - check_error_message(env, con, "CROSSSLOT Keys in request don't hash to the same slot", - 'AI.MODELEXECUTE', 'm{1}', 'INPUTS', 2, 'a{1}', 'b{1}', 'OUTPUTS', 1, 'c') + check_error_message(env, con, "Keys in request don't hash to the same slot", + 'AI.MODELEXECUTE', 'm{1}', 'INPUTS', 2, 'a{1}', 'b', 'OUTPUTS', 1, 'c{1}', error_type=redis.exceptions.ClusterCrossSlotError) + check_error_message(env, con, "Keys in request don't hash to the same slot", + 'AI.MODELEXECUTE', 'm{1}', 'INPUTS', 2, 'a{1}', 'b{1}', 'OUTPUTS', 1, 'c', error_type=redis.exceptions.ClusterCrossSlotError) def test_keys_syntax(env): @@ -319,10 +319,10 @@ def test_pytorch_scriptexecute_errors(env): if env.isCluster(): # cross shard - check_error_message(env, con, "CROSSSLOT Keys in request don't hash to the same slot", 'AI.SCRIPTEXECUTE', 'ket{1}', 'bar', 'KEYS', 1 , '{2}', 'INPUTS', 2, 'a{1}', 'b{1}', 'OUTPUTS', 1, 'c{1}') + check_error_message(env, con, "Keys in request don't hash to the same slot", 'AI.SCRIPTEXECUTE', 'ket{1}', 'bar', 'KEYS', 1 , '{2}', 'INPUTS', 2, 'a{1}', 'b{1}', 'OUTPUTS', 1, 'c{1}', error_type=redis.exceptions.ClusterCrossSlotError) # key doesn't exist - check_error_message(env, con, "CROSSSLOT Keys in request don't hash to the same slot", 'AI.SCRIPTEXECUTE', 'ket{1}', 'bar', 'KEYS', 1 , '{1}', 'INPUTS', 2, 'a{1}', 'b{2}', 'OUTPUTS', 1, 'c{1}') + check_error_message(env, con, "Keys in request don't hash to the same slot", 'AI.SCRIPTEXECUTE', 'ket{1}', 'bar', 'KEYS', 1 , '{1}', 'INPUTS', 2, 'a{1}', 'b{2}', 'OUTPUTS', 1, 'c{1}', error_type=redis.exceptions.ClusterCrossSlotError) def test_pytorch_scriptexecute_variadic_errors(env): diff --git a/tests/flow/tests_dag_errors.py b/tests/flow/tests_dag_errors.py index 7cec8a9e6..331510854 100644 --- a/tests/flow/tests_dag_errors.py +++ b/tests/flow/tests_dag_errors.py @@ -213,7 +213,7 @@ def test_dag_crossslot_violation_errors(env): 'PERSIST', '1', 'resultTensor:{2}', '|>', 'AI.TENSORSET', 'resultTensor:{2}', 'FLOAT', 1, 30, ) - check_error_message(env, con, "CROSSSLOT Keys in request don't hash to the same slot", *command) + check_error_message(env, con, "Keys in request don't hash to the same slot", *command, error_type=redis.exceptions.ClusterCrossSlotError) # ERR CROSSSLOT violation (model key has a different hash tag than the LOAD and PERSIST tensors) command = ( @@ -224,7 +224,7 @@ def test_dag_crossslot_violation_errors(env): 'INPUTS', 1, 'transactionTensor:{1}', 'OUTPUTS', 1, 'resultTensor:{1}', ) - check_error_message(env, con, "CROSSSLOT Keys in request don't hash to the same slot", *command) + check_error_message(env, con, "Keys in request don't hash to the same slot", *command, error_type=redis.exceptions.ClusterCrossSlotError) command = ( 'AI.DAGEXECUTE', 'LOAD', '1', 'referenceTensor:{1}', @@ -235,7 +235,7 @@ def test_dag_crossslot_violation_errors(env): 'INPUTS', 1, 'transactionTensor:{1}', 'OUTPUTS', 1, 'resultTensor:{1}', ) - check_error_message(env, con, "CROSSSLOT Keys in request don't hash to the same slot", *command) + check_error_message(env, con, "Keys in request don't hash to the same slot", *command, error_type=redis.exceptions.ClusterCrossSlotError) def test_dag_tensorget_tensorset_errors(env):