mirror of
https://github.com/wassname/ray.git
synced 2026-06-29 04:44:28 +08:00
[Java] [Test] Move multi-worker config to ray.conf file (#13583)
This commit is contained in:
@@ -23,20 +23,17 @@ public class FailureTest extends BaseTest {
|
||||
|
||||
private static final String EXCEPTION_MESSAGE = "Oops";
|
||||
|
||||
private String oldNumWorkersPerProcess;
|
||||
|
||||
@BeforeClass
|
||||
public void setUp() {
|
||||
// This is needed by `testGetThrowsQuicklyWhenFoundException`.
|
||||
// Set one worker per process. Otherwise, if `badFunc2` and `slowFunc` run in the same
|
||||
// process, `sleep` will delay `System.exit`.
|
||||
oldNumWorkersPerProcess = System.getProperty("ray.job.num-java-workers-per-process");
|
||||
System.setProperty("ray.job.num-java-workers-per-process", "1");
|
||||
}
|
||||
|
||||
@AfterClass
|
||||
public void tearDown() {
|
||||
System.setProperty("ray.job.num-java-workers-per-process", oldNumWorkersPerProcess);
|
||||
System.clearProperty("ray.job.num-java-workers-per-process");
|
||||
}
|
||||
|
||||
public static int badFunc() {
|
||||
|
||||
@@ -10,11 +10,8 @@ import org.testng.annotations.Test;
|
||||
@Test(groups = {"cluster"})
|
||||
public class JobConfigTest extends BaseTest {
|
||||
|
||||
private String oldNumWorkersPerProcess;
|
||||
|
||||
@BeforeClass
|
||||
public void setupJobConfig() {
|
||||
oldNumWorkersPerProcess = System.getProperty("ray.job.num-java-workers-per-process");
|
||||
System.setProperty("ray.job.num-java-workers-per-process", "3");
|
||||
System.setProperty("ray.job.jvm-options.0", "-DX=999");
|
||||
System.setProperty("ray.job.jvm-options.1", "-DY=998");
|
||||
@@ -24,7 +21,7 @@ public class JobConfigTest extends BaseTest {
|
||||
|
||||
@AfterClass
|
||||
public void tearDownJobConfig() {
|
||||
System.setProperty("ray.job.num-java-workers-per-process", oldNumWorkersPerProcess);
|
||||
System.clearProperty("ray.job.num-java-workers-per-process");
|
||||
System.clearProperty("ray.job.jvm-options.0");
|
||||
System.clearProperty("ray.job.jvm-options.1");
|
||||
System.clearProperty("ray.job.worker-env.foo1");
|
||||
|
||||
@@ -14,17 +14,14 @@ import org.testng.annotations.Test;
|
||||
@Test(groups = {"cluster"})
|
||||
public class KillActorTest extends BaseTest {
|
||||
|
||||
private String oldNumWorkersPerProcess;
|
||||
|
||||
@BeforeClass
|
||||
public void setUp() {
|
||||
oldNumWorkersPerProcess = System.getProperty("ray.job.num-java-workers-per-process");
|
||||
System.setProperty("ray.job.num-java-workers-per-process", "1");
|
||||
}
|
||||
|
||||
@AfterClass
|
||||
public void tearDown() {
|
||||
System.setProperty("ray.job.num-java-workers-per-process", oldNumWorkersPerProcess);
|
||||
System.clearProperty("ray.job.num-java-workers-per-process");
|
||||
}
|
||||
|
||||
public static class HangActor {
|
||||
|
||||
@@ -0,0 +1,6 @@
|
||||
ray {
|
||||
job {
|
||||
# Enable multi-worker feature in Java test
|
||||
num-java-workers-per-process: 10
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user