This is an automated email from the ASF dual-hosted git repository.

anirudh2290 pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-mxnet.git


The following commit(s) were added to refs/heads/master by this push:
     new 68efc15  fix custom op fork test (#14753)
68efc15 is described below

commit 68efc1598240bbe36b91d6660489519431795a5d
Author: Wang Jiajun <[email protected]>
AuthorDate: Mon Apr 22 18:36:21 2019 -0500

    fix custom op fork test (#14753)
    
    * fix custom op fork test
    
    * trigger CI
---
 tests/python/gpu/test_operator_gpu.py  | 1 +
 tests/python/unittest/test_operator.py | 5 ++++-
 2 files changed, 5 insertions(+), 1 deletion(-)

diff --git a/tests/python/gpu/test_operator_gpu.py 
b/tests/python/gpu/test_operator_gpu.py
index 19fc1ec..392d0cf 100644
--- a/tests/python/gpu/test_operator_gpu.py
+++ b/tests/python/gpu/test_operator_gpu.py
@@ -48,6 +48,7 @@ from test_contrib_operator import test_multibox_target_op
 set_default_context(mx.gpu(0))
 del test_support_vector_machine_l1_svm  # noqa
 del test_support_vector_machine_l2_svm  # noqa
+del test_custom_op_fork  #noqa
 
 
 def check_countsketch(in_dim,out_dim,n):
diff --git a/tests/python/unittest/test_operator.py 
b/tests/python/unittest/test_operator.py
index f2d8a1b..cef6672 100644
--- a/tests/python/unittest/test_operator.py
+++ b/tests/python/unittest/test_operator.py
@@ -5393,6 +5393,9 @@ def test_custom_op():
         x = mx.nd.Custom(length=10, depth=10, op_type="no_input_op")
     assert_almost_equal(x.asnumpy(), np.ones(shape=(10, 10), dtype=np.float32))
 
+
+@with_seed()
+def test_custom_op_fork():
     # test custom operator fork
     # see https://github.com/apache/incubator-mxnet/issues/14396
     class AdditionOP(mx.operator.CustomOp):
@@ -5430,7 +5433,7 @@ def test_custom_op():
         p.daemon = True
         p.start()
         p.join(5)
-        assert not p.is_alive(), "deadlock may exist in custom operator"
+        assert not p.is_alive() and p.exitcode == 0
 
 
 def _build_dot_custom(fun_forward, name):

Reply via email to