bazel: `bazel coverage` returns empty coverage files for `cc_test` with remote execution
Description of the problem:
Bazel coverage fails with remote execution for cc_test
.
Bugs: what’s the simplest, easiest way to reproduce this bug? Please provide a minimal example if possible.
Either run bazel coverage
on your own RE infrastructure of follow the example posted here:
https://github.com/bazelbuild/bazel/issues/4685#issuecomment-771566167
Using an example such as abseil-cpp:
bazel coverage --config=rbe //absl/flags:config_test --experimental_split_coverage_postprocessing --experimental_fetch_all_coverage_outputs
You’ll notice coverage executes but the coverage files are returned empty. These files are not empty if executed locally (without the extra flags or it will crash).
What operating system are you running Bazel on?
Linux 5.10.16-arch1-1
What’s the output of bazel info release
?
release 4.0.0
Have you found anything relevant by searching the web?
https://github.com/bazelbuild/bazel/issues/13185 https://github.com/bazelbuild/bazel/issues/4685
Any other information, logs, or outputs that you want to share?
About this issue
- Original URL
- State: closed
- Created 3 years ago
- Comments: 18 (10 by maintainers)
Commits related to this issue
- Fix Bazel Coverage with C++ to work with Remote Execution Adds missing coverage files: https://github.com/bazelbuild/bazel/issues/13193 Closes #13232. PiperOrigin-RevId: 367176195 — committed to bazelbuild/bazel by finn-ball 3 years ago
- Fix Bazel Coverage with C++ to work with Remote Execution Adds missing coverage files: https://github.com/bazelbuild/bazel/issues/13193 Closes #13232. PiperOrigin-RevId: 367176195 — committed to bazelbuild/bazel by finn-ball 3 years ago
Hi, trying my luck here before opening a new issue: We still see this behavior with Bazel 5.2.0 in CI on remote caches on
cc_test
s.bazel-out/_coverage/_coverage_report.dat
is created when all tests are green. We have a couple of tests marked asflaky = True
. Observation is that the coverage file is not created if one of these tests shows it’s flaky behavior, i.e. fails in at least one run. Any idea if this is related / is not covered by the fix?