mirror of
https://github.com/wassname/ray.git
synced 2026-06-30 00:49:16 +08:00
Modularize Tune tests from multi-node tests (#4204)
This commit is contained in:
@@ -5,6 +5,7 @@ from __future__ import absolute_import
|
||||
from __future__ import division
|
||||
from __future__ import print_function
|
||||
|
||||
import argparse
|
||||
import click
|
||||
import os
|
||||
import subprocess
|
||||
@@ -12,14 +13,14 @@ import subprocess
|
||||
import ray
|
||||
|
||||
|
||||
def do_link(package):
|
||||
def do_link(package, force=False):
|
||||
package_home = os.path.abspath(
|
||||
os.path.join(ray.__file__, "../{}".format(package)))
|
||||
local_home = os.path.abspath(
|
||||
os.path.join(__file__, "../../{}".format(package)))
|
||||
assert os.path.isdir(package_home), package_home
|
||||
assert os.path.isdir(local_home), local_home
|
||||
if not click.confirm(
|
||||
if not force and not click.confirm(
|
||||
"This will replace:\n {}\nwith a symlink to:\n {}".format(
|
||||
package_home, local_home),
|
||||
default=True):
|
||||
@@ -35,9 +36,16 @@ def do_link(package):
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
do_link("rllib")
|
||||
do_link("tune")
|
||||
do_link("autoscaler")
|
||||
parser = argparse.ArgumentParser(
|
||||
formatter_class=argparse.RawDescriptionHelpFormatter,
|
||||
description="Setup dev.")
|
||||
parser.add_argument(
|
||||
"--yes", action='store_true', help="Don't ask for confirmation.")
|
||||
args = parser.parse_args()
|
||||
|
||||
do_link("rllib", force=args.yes)
|
||||
do_link("tune", force=args.yes)
|
||||
do_link("autoscaler", force=args.yes)
|
||||
print("Created links.\n\nIf you run into issues initializing Ray, please "
|
||||
"ensure that your local repo and the installed Ray are in sync "
|
||||
"(pip install -U the latest wheels at "
|
||||
|
||||
@@ -8,10 +8,6 @@ import time
|
||||
import os
|
||||
import pytest
|
||||
import shutil
|
||||
try:
|
||||
import pytest_timeout
|
||||
except ImportError:
|
||||
pytest_timeout = None
|
||||
|
||||
import ray
|
||||
from ray import tune
|
||||
@@ -134,10 +130,6 @@ def test_remove_node_before_result(start_connected_emptyhead_cluster):
|
||||
runner.step()
|
||||
|
||||
|
||||
@pytest.mark.skipif(
|
||||
pytest_timeout is None,
|
||||
reason="Timeout package not installed; skipping test.")
|
||||
@pytest.mark.timeout(120, method="thread")
|
||||
def test_trial_migration(start_connected_emptyhead_cluster):
|
||||
"""Removing a node while cluster has space should migrate trial.
|
||||
|
||||
@@ -208,10 +200,6 @@ def test_trial_migration(start_connected_emptyhead_cluster):
|
||||
runner.step()
|
||||
|
||||
|
||||
@pytest.mark.skipif(
|
||||
pytest_timeout is None,
|
||||
reason="Timeout package not installed; skipping test.")
|
||||
@pytest.mark.timeout(120, method="thread")
|
||||
def test_trial_requeue(start_connected_emptyhead_cluster):
|
||||
"""Removing a node in full cluster causes Trial to be requeued."""
|
||||
cluster = start_connected_emptyhead_cluster
|
||||
@@ -361,6 +349,7 @@ def test_cluster_down_full(start_connected_cluster, tmpdir):
|
||||
cluster.shutdown()
|
||||
|
||||
|
||||
@pytest.mark.skip(reason="Not very consistent.")
|
||||
def test_cluster_rllib_restore(start_connected_cluster, tmpdir):
|
||||
cluster = start_connected_cluster
|
||||
dirpath = str(tmpdir)
|
||||
|
||||
Reference in New Issue
Block a user