mirror of
https://github.com/vale981/ray
synced 2025-03-05 10:01:43 -05:00
[Java] Some bug fixes about Java UT workflow (#14444)
This commit is contained in:
parent
c53c909130
commit
d653394c7f
2 changed files with 15 additions and 13 deletions
21
java/test.sh
21
java/test.sh
|
@ -98,18 +98,15 @@ RAY_BACKEND_LOG_LEVEL=debug java -cp bazel-bin/java/all_tests_deploy.jar -Dray.a
|
|||
-Dray.redis.password='123456' -Dray.job.code-search-path="$PWD/bazel-bin/java/all_tests_deploy.jar" io.ray.test.MultiDriverTest
|
||||
ray stop
|
||||
|
||||
# See issue #13742 the test is very flaky.
|
||||
# Skipping the doc test for now.
|
||||
|
||||
# echo "Running documentation demo code."
|
||||
# docdemo_path="java/test/src/main/java/io/ray/docdemo/"
|
||||
# for file in "$docdemo_path"*.java; do
|
||||
# file=${file#"$docdemo_path"}
|
||||
# class=${file%".java"}
|
||||
# echo "Running $class"
|
||||
# java -cp bazel-bin/java/all_tests_deploy.jar "io.ray.docdemo.$class"
|
||||
# done
|
||||
# popd
|
||||
echo "Running documentation demo code."
|
||||
docdemo_path="java/test/src/main/java/io/ray/docdemo/"
|
||||
for file in "$docdemo_path"*.java; do
|
||||
file=${file#"$docdemo_path"}
|
||||
class=${file%".java"}
|
||||
echo "Running $class"
|
||||
java -cp bazel-bin/java/all_tests_deploy.jar -Dray.job.num-java-workers-per-process=1 "io.ray.docdemo.$class"
|
||||
done
|
||||
popd
|
||||
|
||||
pushd "$ROOT_DIR"
|
||||
echo "Testing maven install."
|
||||
|
|
|
@ -1,15 +1,20 @@
|
|||
package io.ray.test;
|
||||
|
||||
import com.google.common.collect.ImmutableList;
|
||||
import java.util.List;
|
||||
import org.testng.IClassListener;
|
||||
import org.testng.ITestClass;
|
||||
|
||||
public class SystemPropertyListener implements IClassListener {
|
||||
private final List<String> whitelist = ImmutableList.of("ray.run-mode");
|
||||
|
||||
@Override
|
||||
public void onAfterClass(ITestClass testClass) {
|
||||
for (String key : System.getProperties().stringPropertyNames()) {
|
||||
if (key.startsWith("ray.")) {
|
||||
System.clearProperty(key);
|
||||
if (!whitelist.stream().anyMatch(key::equals)) {
|
||||
System.clearProperty(key);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue