diff --git a/tests/test_api.py b/tests/test_api.py index 34d0805..71774f2 100644 --- a/tests/test_api.py +++ b/tests/test_api.py @@ -41,21 +41,27 @@ def test_fed_apis(): def test_miss_party_name_on_actor(): - compatible_utils.init_ray(address='local') - cluster = { - 'alice': {'address': '127.0.0.1:11012'}, - } - fed.init(cluster=cluster, party="alice") + def run(): + compatible_utils.init_ray(address='local') + cluster = { + 'alice': {'address': '127.0.0.1:11012'}, + } + fed.init(cluster=cluster, party="alice") - @fed.remote - class MyActor: - pass + @fed.remote + class MyActor: + pass - with pytest.raises(ValueError): - MyActor.remote() + with pytest.raises(ValueError): + MyActor.remote() - fed.shutdown() - ray.shutdown() + fed.shutdown() + ray.shutdown() + + p_alice = multiprocessing.Process(target=run) + p_alice.start() + p_alice.join() + assert p_alice.exitcode == 0 if __name__ == "__main__":