[CI] Run Java CI on Mac (#19757)

Why are these changes needed?
Enable Java tests on Mac CI to avoid more breakages.

Related issue number
Closes #19700
This commit is contained in:
Jiajun Yao 2021-11-03 08:40:05 -07:00 committed by GitHub
parent 026bf01071
commit 5de4a38948
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 9 additions and 5 deletions

View file

@ -59,13 +59,17 @@ steps:
- if [ "$BUILDKITE_BRANCH" = "master" ]; then python .buildkite/copy_files.py --destination jars --path ./.jar/darwin; fi
- label: ":mac: :apple: Ray C++ and Libraries"
- label: ":mac: :apple: Ray C++, Java and Libraries"
<<: *common
commands:
- export RAY_INSTALL_JAVA=1
- *prelude_commands
- TORCH_VERSION=1.6 ./ci/travis/install-dependencies.sh
- bazel test --config=ci --test_env=CI $(./scripts/bazel_export_options) --build_tests_only --test_tag_filters=-flaky,-flaky-mac,-post_wheel_build --
//:all python/ray/serve/... python/ray/dashboard/... -rllib/... -core_worker_test
# clang-format is needed by java/test.sh
- pip install clang-format==12.0.1
- ./java/test.sh
- *epilogue_commands
- label: ":mac: :apple: Worker"

View file

@ -36,7 +36,7 @@ public class SystemUtil {
public static boolean isProcessAlive(int pid) {
Process process;
try {
process = Runtime.getRuntime().exec(new String[] {"ps", "-p", String.valueOf(pid)});
process = Runtime.getRuntime().exec(new String[] {"kill", "-0", String.valueOf(pid)});
process.waitFor();
} catch (InterruptedException | IOException e) {
throw new RuntimeException(e);

View file

@ -111,7 +111,7 @@ case "${OSTYPE}" in
darwin*) ip=$(ipconfig getifaddr en0);;
*) echo "Can't get ip address for ${OSTYPE}"; exit 1;;
esac
RAY_BACKEND_LOG_LEVEL=debug ray start --head --port=6379 --redis-password=123456
RAY_BACKEND_LOG_LEVEL=debug ray start --head --port=6379 --redis-password=123456 --node-ip-address="$ip"
RAY_BACKEND_LOG_LEVEL=debug java -cp bazel-bin/java/all_tests_deploy.jar -Dray.address="$ip:6379"\
-Dray.redis.password='123456' -Dray.job.code-search-path="$PWD/bazel-bin/java/all_tests_deploy.jar" io.ray.test.MultiDriverTest
ray stop

View file

@ -35,7 +35,7 @@ public class RayJavaLoggingTest extends BaseTest {
Ray.actor(HeavyLoggingActor::new)
.setJvmOptions(
ImmutableList.of(
"-Dray.logging.max-file-size=1MB", "-Dray.logging.max-backup-files=3"))
"-Dray.logging.max-file-size=1KB", "-Dray.logging.max-backup-files=3"))
.remote();
Assert.assertTrue(loggingActor.task(HeavyLoggingActor::log).remote().get());
final int pid = loggingActor.task(HeavyLoggingActor::getPid).remote().get();
@ -46,7 +46,7 @@ public class RayJavaLoggingTest extends BaseTest {
new File(String.format("%s/java-worker-%s-%d.%d.log", currLogDir, jobId, pid, i));
Assert.assertTrue(rotatedFile.exists());
long fileSize = rotatedFile.length();
Assert.assertTrue(fileSize > 1024 * 1024 && fileSize < 1024 * (1024 + 1));
Assert.assertTrue(fileSize > 1024 && fileSize < 1024 * 2);
}
}
}