[Java] Some bug fixes about Java UT workflow (#14444)

This commit is contained in:
Kai Yang 2021-03-03 19:32:14 +08:00 committed by GitHub
parent c53c909130
commit d653394c7f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 15 additions and 13 deletions

View file

@ -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 -Dray.redis.password='123456' -Dray.job.code-search-path="$PWD/bazel-bin/java/all_tests_deploy.jar" io.ray.test.MultiDriverTest
ray stop ray stop
# See issue #13742 the test is very flaky. echo "Running documentation demo code."
# Skipping the doc test for now. docdemo_path="java/test/src/main/java/io/ray/docdemo/"
for file in "$docdemo_path"*.java; do
# echo "Running documentation demo code." file=${file#"$docdemo_path"}
# docdemo_path="java/test/src/main/java/io/ray/docdemo/" class=${file%".java"}
# for file in "$docdemo_path"*.java; do echo "Running $class"
# file=${file#"$docdemo_path"} java -cp bazel-bin/java/all_tests_deploy.jar -Dray.job.num-java-workers-per-process=1 "io.ray.docdemo.$class"
# class=${file%".java"} done
# echo "Running $class" popd
# java -cp bazel-bin/java/all_tests_deploy.jar "io.ray.docdemo.$class"
# done
# popd
pushd "$ROOT_DIR" pushd "$ROOT_DIR"
echo "Testing maven install." echo "Testing maven install."

View file

@ -1,15 +1,20 @@
package io.ray.test; package io.ray.test;
import com.google.common.collect.ImmutableList;
import java.util.List;
import org.testng.IClassListener; import org.testng.IClassListener;
import org.testng.ITestClass; import org.testng.ITestClass;
public class SystemPropertyListener implements IClassListener { public class SystemPropertyListener implements IClassListener {
private final List<String> whitelist = ImmutableList.of("ray.run-mode");
@Override @Override
public void onAfterClass(ITestClass testClass) { public void onAfterClass(ITestClass testClass) {
for (String key : System.getProperties().stringPropertyNames()) { for (String key : System.getProperties().stringPropertyNames()) {
if (key.startsWith("ray.")) { if (key.startsWith("ray.")) {
System.clearProperty(key); if (!whitelist.stream().anyMatch(key::equals)) {
System.clearProperty(key);
}
} }
} }
} }