Skip to content

Commit cfeee79

Browse files
chayimDvirDukhan
andauthored
redis dependencies to get to 4.1.4 (#902)
Co-authored-by: DvirDukhan <[email protected]>
1 parent f194ab3 commit cfeee79

File tree

5 files changed

+18
-21
lines changed

5 files changed

+18
-21
lines changed

opt/system-setup.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -71,8 +71,6 @@ def common_last(self):
7171
else:
7272
self.run("%s/bin/getcmake" % READIES)
7373

74-
self.run("{PYTHON} {READIES}/bin/getrmpytools".format(PYTHON=self.python, READIES=READIES))
75-
7674
self.pip_install("-r %s/tests/flow/tests_setup/test_requirements.txt" % ROOT)
7775

7876
self.pip_install("awscli")

tests/flow/includes.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -202,7 +202,7 @@ def run_test_multiproc(env, routing_hint, n_procs, fn, args=tuple()):
202202
procs = []
203203

204204
def tmpfn():
205-
con = env.getConnectionByKey(routing_hint, None)
205+
con = env.getConnectionByKey(routing_hint, 'SET')
206206
fn(con, *args)
207207
return 1
208208

@@ -222,26 +222,26 @@ def load_file_content(file_name):
222222
return f.read()
223223

224224

225-
def check_error_message(env, con, error_msg, *command, error_msg_is_substr=False):
225+
def check_error_message(env, con, error_msg, *command, error_msg_is_substr=False, error_type=redis.exceptions.ResponseError):
226226
try:
227227
con.execute_command(*command)
228228
env.assertFalse(True, message=get_caller_pos())
229229
except Exception as exception:
230-
env.assertEqual(type(exception), redis.exceptions.ResponseError, message=get_caller_pos())
230+
env.assertEqual(type(exception), error_type, message=get_caller_pos())
231231
if error_msg_is_substr:
232232
# We only verify that the given error_msg is a substring of the entire error message.
233233
env.assertTrue(str(exception).find(error_msg) >= 0, message=get_caller_pos())
234234
else:
235235
env.assertEqual(error_msg, str(exception), message=get_caller_pos())
236236

237237

238-
def check_error(env, con, *command):
238+
def check_error(env, con, *command, error_type=redis.exceptions.ResponseError):
239239
try:
240240
con.execute_command(*command)
241241
env.assertFalse(True, message=get_caller_pos())
242242
except Exception as e:
243243
exception = e
244-
env.assertEqual(type(exception), redis.exceptions.ResponseError, message=get_caller_pos())
244+
env.assertTrue(issubclass(type(exception), error_type), message=get_caller_pos())
245245

246246

247247
# Returns a dict with all the fields of a certain section from INFO MODULES command
@@ -253,4 +253,4 @@ def get_info_section(con, section):
253253

254254

255255
def get_connection(env, routing_hint):
256-
return env.getConnectionByKey(routing_hint, None)
256+
return env.getConnectionByKey(routing_hint, 'SET')

tests/flow/tests_commands.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -147,10 +147,10 @@ def test_modelexecute_errors(env):
147147

148148
# The following 2 commands should raise an error on cluster mode (keys are not on the same shard)
149149
if env.isCluster():
150-
check_error_message(env, con, "CROSSSLOT Keys in request don't hash to the same slot",
151-
'AI.MODELEXECUTE', 'm{1}', 'INPUTS', 2, 'a{1}', 'b', 'OUTPUTS', 1, 'c{1}')
152-
check_error_message(env, con, "CROSSSLOT Keys in request don't hash to the same slot",
153-
'AI.MODELEXECUTE', 'm{1}', 'INPUTS', 2, 'a{1}', 'b{1}', 'OUTPUTS', 1, 'c')
150+
check_error_message(env, con, "Keys in request don't hash to the same slot",
151+
'AI.MODELEXECUTE', 'm{1}', 'INPUTS', 2, 'a{1}', 'b', 'OUTPUTS', 1, 'c{1}', error_type=redis.exceptions.ClusterCrossSlotError)
152+
check_error_message(env, con, "Keys in request don't hash to the same slot",
153+
'AI.MODELEXECUTE', 'm{1}', 'INPUTS', 2, 'a{1}', 'b{1}', 'OUTPUTS', 1, 'c', error_type=redis.exceptions.ClusterCrossSlotError)
154154

155155

156156
def test_keys_syntax(env):
@@ -319,10 +319,10 @@ def test_pytorch_scriptexecute_errors(env):
319319

320320
if env.isCluster():
321321
# cross shard
322-
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}')
322+
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)
323323

324324
# key doesn't exist
325-
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}')
325+
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)
326326

327327

328328
def test_pytorch_scriptexecute_variadic_errors(env):

tests/flow/tests_dag_errors.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -213,7 +213,7 @@ def test_dag_crossslot_violation_errors(env):
213213
'PERSIST', '1', 'resultTensor:{2}', '|>',
214214
'AI.TENSORSET', 'resultTensor:{2}', 'FLOAT', 1, 30,
215215
)
216-
check_error_message(env, con, "CROSSSLOT Keys in request don't hash to the same slot", *command)
216+
check_error_message(env, con, "Keys in request don't hash to the same slot", *command, error_type=redis.exceptions.ClusterCrossSlotError)
217217

218218
# ERR CROSSSLOT violation (model key has a different hash tag than the LOAD and PERSIST tensors)
219219
command = (
@@ -224,7 +224,7 @@ def test_dag_crossslot_violation_errors(env):
224224
'INPUTS', 1, 'transactionTensor:{1}',
225225
'OUTPUTS', 1, 'resultTensor:{1}',
226226
)
227-
check_error_message(env, con, "CROSSSLOT Keys in request don't hash to the same slot", *command)
227+
check_error_message(env, con, "Keys in request don't hash to the same slot", *command, error_type=redis.exceptions.ClusterCrossSlotError)
228228

229229
command = (
230230
'AI.DAGEXECUTE', 'LOAD', '1', 'referenceTensor:{1}',
@@ -235,7 +235,7 @@ def test_dag_crossslot_violation_errors(env):
235235
'INPUTS', 1, 'transactionTensor:{1}',
236236
'OUTPUTS', 1, 'resultTensor:{1}',
237237
)
238-
check_error_message(env, con, "CROSSSLOT Keys in request don't hash to the same slot", *command)
238+
check_error_message(env, con, "Keys in request don't hash to the same slot", *command, error_type=redis.exceptions.ClusterCrossSlotError)
239239

240240

241241
def test_dag_tensorget_tensorset_errors(env):
Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
numpy>=1.19
22
scikit-image
3-
redis-py-cluster
43
redisai
5-
redis>=3.0.0
6-
git+https://github.com/Grokzen/redis-py-cluster.git@master
7-
git+https://github.com/RedisLabsModules/RLTest.git@master
4+
redis>=4.1.4
5+
rltest>=0.5.0
6+
ramp-packer>=2.3.0

0 commit comments

Comments
 (0)