aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/test
diff options
context:
space:
mode:
authorGravatar olaola <olaola@google.com>2017-04-20 17:14:31 +0200
committerGravatar Vladimir Moskva <vladmos@google.com>2017-04-24 16:47:42 +0200
commit3f5442da4f9b8d4e01bf80ea134c05245e6551e0 (patch)
treeb3b48db6deeaea25dbe8f80931e711e863f2b971 /src/test
parent27a136b9bbb4d73b0a343d407b5da9f890175aea (diff)
Enabling chunking of outputs in the RemoteWorker downloadBlob. This fixes the bug that the RemoteWorker would fail to upload outputs that were too big to send in a single gRPC message.
Fixes #2822. RELNOTES: n/a PiperOrigin-RevId: 153710733
Diffstat (limited to 'src/test')
-rwxr-xr-xsrc/test/shell/bazel/remote_execution_test.sh34
1 files changed, 34 insertions, 0 deletions
diff --git a/src/test/shell/bazel/remote_execution_test.sh b/src/test/shell/bazel/remote_execution_test.sh
index 7dd6949b64..f3514d2593 100755
--- a/src/test/shell/bazel/remote_execution_test.sh
+++ b/src/test/shell/bazel/remote_execution_test.sh
@@ -30,6 +30,7 @@ function set_up() {
${bazel_data}/src/tools/remote_worker/remote_worker \
--work_path=${work_path} \
--listen_port=${worker_port} \
+ --grpc_max_chunk_size_bytes=120000000 \
--hazelcast_standalone_listen_port=${hazelcast_port} \
--pid_file=${pid_file} >& $TEST_log &
local wait_seconds=0
@@ -128,6 +129,39 @@ EOF
|| fail "Remote cache generated different result"
}
+# Tests that the remote worker can return a 200MB blob that requires chunking.
+# Blob has to be that large in order to exceed the grpc default max message size.
+function test_genrule_large_output_chunking() {
+ mkdir -p a
+ cat > a/BUILD <<EOF
+package(default_visibility = ["//visibility:public"])
+genrule(
+name = "large_output",
+srcs = ["small_blob.txt"],
+outs = ["large_blob.txt"],
+cmd = "cp \$(location small_blob.txt) tmp.txt; " +
+"(for i in {1..22} ; do cat tmp.txt >> \$@; cp \$@ tmp.txt; done)",
+)
+EOF
+ cat > a/small_blob.txt <<EOF
+0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890
+EOF
+ bazel build //a:large_output >& $TEST_log \
+ || fail "Failed to build //a:large_output without remote execution"
+ cp -f bazel-genfiles/a/large_blob.txt ${TEST_TMPDIR}/large_blob_expected.txt
+
+ bazel clean --expunge
+ bazel --host_jvm_args=-Dbazel.DigestFunction=SHA1 build \
+ --spawn_strategy=remote \
+ --grpc_max_chunk_size_bytes=120000000 \
+ --remote_worker=localhost:${worker_port} \
+ --remote_cache=localhost:${worker_port} \
+ //a:large_output >& $TEST_log \
+ || fail "Failed to build //a:large_output with remote execution"
+ diff bazel-genfiles/a/large_blob.txt ${TEST_TMPDIR}/large_blob_expected.txt \
+ || fail "Remote execution generated different result"
+}
+
function test_cc_binary_rest_cache() {
mkdir -p a
cat > a/BUILD <<EOF