Commit 3dd2b93
Fix null pointer crash with
This is a follow-up to 2f1ff6f. That
patch accidentally introduced a crash when running coverage on tests
where all tests are incompatible.
FATAL: bazel crashed due to an internal error. Printing stack trace:
java.lang.NullPointerException: Null reportGenerator
at com.google.devtools.build.lib.bazel.coverage.AutoValue_CoverageArgs.<init>(AutoValue_CoverageArgs.java:68)
at com.google.devtools.build.lib.bazel.coverage.CoverageArgs.create(CoverageArgs.java:58)
at com.google.devtools.build.lib.bazel.coverage.CoverageReportActionBuilder.createCoverageActionsWrapper(CoverageReportActionBuilder.java:226)
at com.google.devtools.build.lib.bazel.coverage.BazelCoverageReportModule$1.createCoverageReportActionsWrapper(BazelCoverageReportModule.java:98)
at com.google.devtools.build.lib.analysis.BuildView.createResult(BuildView.java:558)
at com.google.devtools.build.lib.analysis.BuildView.update(BuildView.java:492)
at com.google.devtools.build.lib.buildtool.AnalysisPhaseRunner.runAnalysisPhase(AnalysisPhaseRunner.java:227)
at com.google.devtools.build.lib.buildtool.AnalysisPhaseRunner.execute(AnalysisPhaseRunner.java:137)
at com.google.devtools.build.lib.buildtool.BuildTool.buildTargets(BuildTool.java:266)
at com.google.devtools.build.lib.buildtool.BuildTool.processRequest(BuildTool.java:506)
at com.google.devtools.build.lib.buildtool.BuildTool.processRequest(BuildTool.java:474)
at com.google.devtools.build.lib.runtime.commands.TestCommand.doTest(TestCommand.java:148)
at com.google.devtools.build.lib.runtime.commands.TestCommand.exec(TestCommand.java:113)
at com.google.devtools.build.lib.runtime.BlazeCommandDispatcher.execExclusively(BlazeCommandDispatcher.java:584)
at com.google.devtools.build.lib.runtime.BlazeCommandDispatcher.exec(BlazeCommandDispatcher.java:231)
at com.google.devtools.build.lib.server.GrpcServerImpl.executeCommand(GrpcServerImpl.java:550)
at com.google.devtools.build.lib.server.GrpcServerImpl.lambda$run$1(GrpcServerImpl.java:614)
at io.grpc.Context$1.run(Context.java:566)
at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
at java.base/java.lang.Thread.run(Unknown Source)
This patch fixes the crash by handling the situation properly. This
results in all tests being skipped and reported as being skipped.
A new test validates the correct behaviour.
Closes bazelbuild#15645.
PiperOrigin-RevId: 454132787
Change-Id: Id1cd4109f96d90bbdc114b0bbe7f5c5046d47c27bazel coverage on only incompatible tests1 parent c945c16 commit 3dd2b93
File tree
2 files changed
+39
-2
lines changed- src
- main/java/com/google/devtools/build/lib/bazel/coverage
- test/shell/bazel
2 files changed
+39
-2
lines changedLines changed: 4 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
212 | 212 | | |
213 | 213 | | |
214 | 214 | | |
| 215 | + | |
| 216 | + | |
| 217 | + | |
| 218 | + | |
215 | 219 | | |
216 | 220 | | |
217 | 221 | | |
| |||
Lines changed: 35 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
28 | 28 | | |
29 | 29 | | |
30 | 30 | | |
| 31 | + | |
31 | 32 | | |
32 | 33 | | |
33 | 34 | | |
| |||
40 | 41 | | |
41 | 42 | | |
42 | 43 | | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
43 | 49 | | |
44 | 50 | | |
45 | 51 | | |
| |||
51 | 57 | | |
52 | 58 | | |
53 | 59 | | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
54 | 75 | | |
55 | 76 | | |
56 | | - | |
57 | | - | |
| 77 | + | |
| 78 | + | |
58 | 79 | | |
59 | 80 | | |
60 | 81 | | |
61 | 82 | | |
62 | 83 | | |
63 | 84 | | |
64 | 85 | | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
65 | 98 | | |
66 | 99 | | |
67 | 100 | | |
0 commit comments