From e9bb140b7d5bb38f0068a87222a4c1a6e3d88a20 Mon Sep 17 00:00:00 2001 From: Jieru Hong <30741238+respecteverything@users.noreply.github.com> Date: Thu, 15 Aug 2019 10:02:37 +0800 Subject: [PATCH] modify run-pytests to check version before test ray (#1532) * Create .keep * update .keep path * add rl_pong example * move to rl_pong direction * remove original file * add parameter server example * add license * PEP8 checks * PEP8 checks * Add into integration test * Wrap tests into bash function * Update license * PEP8 checks * Correct syntax of rl_pong * modify run-pytests to check version before test ray * test pyspark version and spark home * add check spark_home's pyspark in case pyspark can't be found * add check version before run ray examples * change spark home * change spark home * install packages which are needed in ray examples * check error * fix error * change execution to spark-submit * change memory * change object memory to test * add atari_py dependency * remove .keep * move ray test to new files * change some ray-pip lines into function * remove rl_pong and fix parameter_server iterations * add iteration * change iterate, print info * add more info * add __init__ files * change ray to rayexample to avoid conflict and change spark-submit to python to submit tasks * renamed foreach_evaluator to foreach_worker because rllib update and rename file rllib to rllibexample * add a dedicated file for the ray test * PEP8 check fix * PEP8 check fix * remove test_split * remove --doctest-modules about ray * add time.sleep --- .../test/bigdl/orca/ray/test_ray_on_local.py | 2 ++ python/orca/test/bigdl/orca/ray/test_util.py | 16 ++++++++-------- 2 files changed, 10 insertions(+), 8 deletions(-) diff --git a/python/orca/test/bigdl/orca/ray/test_ray_on_local.py b/python/orca/test/bigdl/orca/ray/test_ray_on_local.py index 563421f53db..61dc3703d23 100644 --- a/python/orca/test/bigdl/orca/ray/test_ray_on_local.py +++ b/python/orca/test/bigdl/orca/ray/test_ray_on_local.py @@ -19,6 +19,7 @@ import psutil import pytest import ray +import time from zoo import init_spark_on_local from zoo.ray.util.raycontext import RayContext @@ -44,6 +45,7 @@ def test_local(self): print([ray.get(actor.hostname.remote()) for actor in actors]) ray_ctx.stop() sc.stop() + time.sleep(1) for process_info in ray_ctx.ray_processesMonitor.process_infos: for pid in process_info.pids: assert not psutil.pid_exists(pid) diff --git a/python/orca/test/bigdl/orca/ray/test_util.py b/python/orca/test/bigdl/orca/ray/test_util.py index ee2b4d70bfe..abbf5d55620 100644 --- a/python/orca/test/bigdl/orca/ray/test_util.py +++ b/python/orca/test/bigdl/orca/ray/test_util.py @@ -25,14 +25,14 @@ class TestUtil(TestCase): - def test_split(self): - vector = np.ones([10]) - result = rutils.split(vector, 4) - assert len(result) == 4 - assert len(result[0]) == 3 - assert len(result[1]) == 3 - assert len(result[2]) == 2 - assert len(result[3]) == 2 + # def test_split(self): + # vector = np.ones([10]) + # result = rutils.split(vector, 4) + # assert len(result) == 4 + # assert len(result[0]) == 3 + # assert len(result[1]) == 3 + # assert len(result[2]) == 2 + # assert len(result[3]) == 2 def test_resource_to_bytes(self): assert 10 == rutils.resourceToBytes("10b")