[fix] Fix ray.home configuration item. (#2977)

If we set `ray.home` configuration item to `""`.
The current `RayConfig` will set it to current work directory, like `/User/My/Ray`.
But the some other configuration items(like `redisServerExecutablePath`) will be set to `/User/My/Ray//build/src/common/thirdparty/redis/src/redis-server` by mistake.
Note: There are 2 `/` between current work directory and `build/src/common....`

This PR will fix this issue.
This commit is contained in:
Wang Qing
2018-09-28 13:06:14 +08:00
committed by Robert Nishihara
parent 5eaf429c53
commit 68cf194e90
2 changed files with 12 additions and 5 deletions
@@ -16,5 +16,11 @@ public class RayConfigTest {
Assert.assertEquals("/path/to/ray", rayConfig.rayHome);
Assert.assertEquals(WorkerMode.DRIVER, rayConfig.workerMode);
Assert.assertEquals(RunMode.CLUSTER, rayConfig.runMode);
System.setProperty("ray.home", "");
rayConfig = RayConfig.create();
Assert.assertEquals(System.getProperty("user.dir"), rayConfig.rayHome);
Assert.assertEquals(System.getProperty("user.dir") +
"/build/src/common/thirdparty/redis/src/redis-server", rayConfig.redisServerExecutablePath);
}
}