diff options
author | Klaus Aehlig <aehlig@google.com> | 2017-10-24 15:19:01 +0200 |
---|---|---|
committer | Dmitry Lomov <dslomov@google.com> | 2017-10-24 17:05:16 +0200 |
commit | e05c84fdfd2a5ae80a8cc0a01c7460064ccfbbf8 (patch) | |
tree | d9d0f497fd1516aba6d8a8b10512fd138d28193f /src/main/java/com/google/devtools/build/lib/runtime | |
parent | 8d58ec1e92c8fd8ca04b419f1fe2486401c18e9e (diff) |
BEP: correctly close stream in case of a circular dependency
If the build is aborted due to a cyclic dependency, correctly
report so in the build event protocol. In particular, close the
stream of events.
Change-Id: Iff86213904a99c6af6a1da90fb229bba8e51c91f
PiperOrigin-RevId: 173247825
Diffstat (limited to 'src/main/java/com/google/devtools/build/lib/runtime')
-rw-r--r-- | src/main/java/com/google/devtools/build/lib/runtime/commands/TestCommand.java | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/main/java/com/google/devtools/build/lib/runtime/commands/TestCommand.java b/src/main/java/com/google/devtools/build/lib/runtime/commands/TestCommand.java index 60b35bf23b..1e3f61a97a 100644 --- a/src/main/java/com/google/devtools/build/lib/runtime/commands/TestCommand.java +++ b/src/main/java/com/google/devtools/build/lib/runtime/commands/TestCommand.java @@ -131,7 +131,10 @@ public class TestCommand implements BlazeCommand { // (original exitcode=BUILD_FAILURE) or if there weren't but --noanalyze was given // (original exitcode=SUCCESS). env.getReporter().handle(Event.error("Couldn't start the build. Unable to run tests")); - return buildResult.getSuccess() ? ExitCode.PARSING_FAILURE : buildResult.getExitCondition(); + ExitCode exitCode = + buildResult.getSuccess() ? ExitCode.PARSING_FAILURE : buildResult.getExitCondition(); + env.getEventBus().post(new TestingCompleteEvent(exitCode, buildResult.getStopTime())); + return exitCode; } // TODO(bazel-team): the check above shadows NO_TESTS_FOUND, but switching the conditions breaks // more tests |