aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/test/shell/integration/run_test.sh
diff options
context:
space:
mode:
authorGravatar Janak Ramakrishnan <janakr@google.com>2017-05-17 21:46:54 +0200
committerGravatar Dmitry Lomov <dslomov@google.com>2017-05-19 15:07:53 +0200
commit0182ce606e046ad301bee998a66ced1463ef8d88 (patch)
tree43920b99fe3a73df88dbbf7c5f5cddfa371df2a9 /src/test/shell/integration/run_test.sh
parenteca2840d7d9a62a875871c36c077b55ff180ef65 (diff)
Use $TEST_TMPDIR for test_interrupt_kills_child.
Fixes #2938 where concurrently running tests can step on each other. Change-Id: I1d75dd323149c4f892f8d5a28c1abf9ff055abca PiperOrigin-RevId: 156340949
Diffstat (limited to 'src/test/shell/integration/run_test.sh')
-rwxr-xr-xsrc/test/shell/integration/run_test.sh9
1 files changed, 5 insertions, 4 deletions
diff --git a/src/test/shell/integration/run_test.sh b/src/test/shell/integration/run_test.sh
index ce39bdbf55..b322c858bc 100755
--- a/src/test/shell/integration/run_test.sh
+++ b/src/test/shell/integration/run_test.sh
@@ -173,10 +173,11 @@ function test_consistent_command_line_encoding {
function test_interrupt_kills_child() {
mkdir -p foo || fail "mkdir foo failed"
- rm -f /tmp/sleep-minute-pipe
- mkfifo /tmp/sleep-minute-pipe || fail "make pipe failed"
+ pipe_file="${TEST_TMPDIR}/sleep-minute-pipe"
+ rm -f "$pipe_file"
+ mkfifo "$pipe_file" || fail "make pipe failed"
echo 'sh_binary(name = "sleep-minute", srcs = ["sleep-minute.sh"])' > foo/BUILD
- echo -e "#!/bin/bash\n"'echo $$ >/tmp/sleep-minute-pipe'"\n"'sleep 60' > foo/sleep-minute.sh
+ echo -e "#!/bin/bash\n"'echo $$ >'"${pipe_file}\n"'sleep 60' > foo/sleep-minute.sh
chmod +x foo/sleep-minute.sh
# Note that if bazel info is not executed before the actual bazel run, this script would have to
# be run in "monitor mode" (with the command set -m) for bazel or the server to receive SIGINT.
@@ -186,7 +187,7 @@ function test_interrupt_kills_child() {
fi
(bazel run //foo:sleep-minute || true) &
local sleeppid
- read sleeppid </tmp/sleep-minute-pipe
+ read sleeppid <"$pipe_file"
if [ -z $sleeppid ]; then
fail "${PRODUCT_NAME} run did not invoke shell script"
fi