aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorGravatar Klaus Aehlig <aehlig@google.com>2017-11-21 08:22:32 -0800
committerGravatar Copybara-Service <copybara-piper@google.com>2017-11-21 08:25:57 -0800
commit7f72af113960386006598150e880a79b5f0bc2e1 (patch)
treee0f3415c37474ebab8783cdd74ebac75348ec6de
parentedc3901ecaafdb778a8e9fac463af1b2812f8f48 (diff)
Fix //src/test/shell/integration:progress_reporting_test
The test case test_failed_actions_with_keep_going was never correct and only worked by accident: it relied on bazel starting at least two actions, if for there are at least two where all the dependencies are already met; however bazel is clever and analyzes the resources of the system it is running in, and if they are small will only run one genrule at a time. Fix this by telling it to run 2 actions and lying about the available resources of the local system. Also increase the test size and reenable the test for remote execution. Fixes #3995. Change-Id: Ic84de17a98a2e74c24901d4efb38d7631de4690a PiperOrigin-RevId: 176511026
-rw-r--r--scripts/ci/bazel-tests-remote.json2
-rw-r--r--src/test/shell/integration/BUILD2
-rwxr-xr-xsrc/test/shell/integration/progress_reporting_test.sh10
3 files changed, 11 insertions, 3 deletions
diff --git a/scripts/ci/bazel-tests-remote.json b/scripts/ci/bazel-tests-remote.json
index 00f376756f..6123068428 100644
--- a/scripts/ci/bazel-tests-remote.json
+++ b/scripts/ci/bazel-tests-remote.json
@@ -26,7 +26,7 @@
"--java_toolchain=@bazel_toolchains//configs/java/0.1.0/bazel_0.6.0:remote_toolchain"
],
"tests": [
- "tests(//src/test/shell/integration/...) - //src/test/shell/integration:progress_reporting_test",
+ "//src/test/shell/integration/...",
"//src/test/java/... - //src/test/java/com/google/devtools/build/android/..."
],
"test_tag_filters": ["-slow"],
diff --git a/src/test/shell/integration/BUILD b/src/test/shell/integration/BUILD
index 75471033f2..871060b964 100644
--- a/src/test/shell/integration/BUILD
+++ b/src/test/shell/integration/BUILD
@@ -16,7 +16,7 @@ filegroup(
sh_test(
name = "progress_reporting_test",
- size = "medium",
+ size = "large",
srcs = ["progress_reporting_test.sh"],
data = [":test-deps"],
shard_count = 8,
diff --git a/src/test/shell/integration/progress_reporting_test.sh b/src/test/shell/integration/progress_reporting_test.sh
index b42e28ec46..6027b5a406 100755
--- a/src/test/shell/integration/progress_reporting_test.sh
+++ b/src/test/shell/integration/progress_reporting_test.sh
@@ -273,7 +273,15 @@ genrule(
)
EOF
- bazel build -k -s "//${pkg}:"{top,longrun} --progress_report_interval=1 \
+ # The whole test setup relies on bazel running the actions for
+ # :dep and :longrun in parallel. However, bazel normally analyzes
+ # the environment and bases the action scheduling on this; so we
+ # need to tell bazel to (maybe even contrafactually) believe that
+ # there are enough local resources for two genrules to run in parallel.
+ # Give enough head room so that the test won't break again if we tweak
+ # our assumptions about local resource usage.
+ bazel build -j 2 --local_resources=2048000,32,32 \
+ -k -s "//${pkg}:"{top,longrun} --progress_report_interval=1 \
>& "$TEST_log" && fail "build succeeded"
expect_log "\[3 / 4\] Still waiting for 1 job to complete:"
expect_log "^ *Executing genrule //${pkg}:longrun"