Skip to content

Commit 01ee275

Browse files
committed
Merge pull request #592 from RedisAI/thread_join_on_tests
1 parent 08bb9a4 commit 01ee275

File tree

3 files changed

+7
-2
lines changed

3 files changed

+7
-2
lines changed

tests/flow/tests_dag.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -761,6 +761,7 @@ def run():
761761
'AI.TENSORGET', result_tensor_keyname, 'META',
762762
)
763763

764+
t.join()
764765
ensureSlaveSynced(con, env)
765766

766767
env.assertEqual([b'OK',b'OK',[b'dtype', b'FLOAT', b'shape', [1, 2]]], ret)

tests/flow/tests_onnx.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -215,6 +215,7 @@ def run():
215215
t.start()
216216

217217
con.execute_command('AI.MODELRUN', 'm{1}', 'INPUTS', 'a{1}', 'OUTPUTS', 'b{1}')
218+
t.join()
218219

219220
ensureSlaveSynced(con, env)
220221

tests/flow/tests_pytorch.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -269,7 +269,8 @@ def test_pytorch_modelrun_autobatch_badbatch(env):
269269
def run():
270270
con = env.getConnection()
271271
try:
272-
con.execute_command('AI.MODELRUN', 'm{1}', 'INPUTS', 'd{1}', 'e{1}', 'OUTPUTS', 'f1{1}', 'f2{1}')
272+
ret = con.execute_command('AI.MODELRUN', 'm{1}', 'INPUTS', 'd{1}', 'e{1}', 'OUTPUTS', 'f1{1}', 'f2{1}')
273+
env.assertEqual(ret, b'OK')
273274
except Exception as e:
274275
exception = e
275276
env.assertEqual(type(exception), redis.exceptions.ResponseError)
@@ -279,11 +280,13 @@ def run():
279280
t.start()
280281

281282
try:
282-
con.execute_command('AI.MODELRUN', 'm{1}', 'INPUTS', 'a{1}', 'b{1}', 'OUTPUTS', 'c1{1}', 'c2{1}')
283+
ret = con.execute_command('AI.MODELRUN', 'm{1}', 'INPUTS', 'a{1}', 'b{1}', 'OUTPUTS', 'c1{1}', 'c2{1}')
284+
env.assertEqual(ret, b'OK')
283285
except Exception as e:
284286
exception = e
285287
env.assertEqual(type(exception), redis.exceptions.ResponseError)
286288
env.assertEqual("Model did not generate the expected batch size", exception.__str__())
289+
t.join()
287290

288291

289292

0 commit comments

Comments
 (0)