Fix bug when connecting another driver in local case. (#1760)

* Allow connecting another driver when using ip address 127.0.0.1.

* Add test.
This commit is contained in:
Robert Nishihara
2018-03-21 11:49:53 -07:00
committed by Philipp Moritz
parent 5c7ef34b05
commit c6ad71fc9d
2 changed files with 23 additions and 1 deletions
+19
View File
@@ -283,5 +283,24 @@ class StartRayScriptTest(unittest.TestCase):
subprocess.Popen(["ray", "stop"]).wait()
class MiscellaneousTest(unittest.TestCase):
def tearDown(self):
ray.worker.cleanup()
def testConnectingInLocalCase(self):
address_info = ray.init(num_cpus=0)
# Define a driver that just connects to Redis.
driver_script = """
import ray
ray.init(redis_address="{}")
print("success")
""".format(address_info["redis_address"])
out = run_string_as_driver(driver_script)
# Make sure the other driver succeeded.
self.assertIn("success", out)
if __name__ == "__main__":
unittest.main(verbosity=2)