From e05c84fdfd2a5ae80a8cc0a01c7460064ccfbbf8 Mon Sep 17 00:00:00 2001 From: Klaus Aehlig Date: Tue, 24 Oct 2017 15:19:01 +0200 Subject: 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 --- .../com/google/devtools/build/lib/runtime/commands/TestCommand.java | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'src/main/java/com/google/devtools/build/lib/runtime') 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 -- cgit v1.2.3