Skip to content

Commit 81e570c

Browse files
meteorcloudycopybara-github
authored andcommitted
Fix //src/test/shell/bazel/remote:remote_execution_test test
The stop_worker function in remote_utils.sh was broken with an unbounded variable error. This error somehow shadowed the return code of the test cases on macOS. Fixes bazelbuild#12377 Fixes bazelbuild#12376 Closes bazelbuild#12629. PiperOrigin-RevId: 346038409
1 parent d113d74 commit 81e570c

File tree

1 file changed

+9
-4
lines changed

1 file changed

+9
-4
lines changed

src/test/shell/bazel/remote/remote_utils.sh

+9-4
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,11 @@
1919
REMOTE_WORKER="$(rlocation io_bazel/src/tools/remote/worker)"
2020

2121
function start_worker() {
22-
work_path=$(mktemp -d "${TEST_TMPDIR}/remote.XXXXXXXX")
23-
cas_path=$(mktemp -d "${TEST_TMPDIR}/remote.XXXXXXXX")
24-
pid_file=$(mktemp -u "${TEST_TMPDIR}/remote.XXXXXXXX")
22+
work_path="${TEST_TMPDIR}/remote.work_path"
23+
cas_path="${TEST_TMPDIR}/remote.cas_path"
24+
pid_file="${TEST_TMPDIR}/remote.pid_file"
25+
mkdir -p "${work_path}"
26+
mkdir -p "${cas_path}"
2527
worker_port=$(pick_random_unused_tcp_port) || fail "no port found"
2628
native_lib="${BAZEL_RUNFILES}/src/main/native/"
2729
"${REMOTE_WORKER}" \
@@ -43,10 +45,13 @@ function start_worker() {
4345
}
4446

4547
function stop_worker() {
48+
work_path="${TEST_TMPDIR}/remote.work_path"
49+
cas_path="${TEST_TMPDIR}/remote.cas_path"
50+
pid_file="${TEST_TMPDIR}/remote.pid_file"
4651
if [ -s "${pid_file}" ]; then
4752
local pid=$(cat "${pid_file}")
4853
kill -9 "${pid}"
49-
rm -rf "${pid_file}"
54+
rm -rf "${pid_file}"
5055
fi
5156
if [ -d "${work_path}" ]; then
5257
rm -rf "${work_path}"

0 commit comments

Comments
 (0)