Track success of builders directly, rather than using stage status.
Currently we track whether a builder succeeds by trying to parse the
list of stages that passed and failed. This is somewhat error prone, as
shown in Bug 393600.
An example case where the old logic can fail is in a grouped builder and
the first board fails in BuildPackages. In this case, subsequent boards
have no failed stages, and they are incorrectly marked as successful.
To solve this more accurately, we now instead set a variable when a board
passes, and otherwise assume that the board failed. This approach is always
correct at determining whether a board passed, and simpler.
Note: In cases where a builder does not have any boards, or has child builders,
we fall back and instead just look at whether the entire build was successful.
BUG=chromium:393600
TEST=Run it.
TEST=Run lumpy-incremental-paladin and verify it's marked as successful.
Change-Id: I99582c6b37d263f7cadf9d57fe2354c3e6c854f3
Reviewed-on: https://chromium-review.googlesource.com/208256
Tested-by: David James <davidjames@chromium.org>
Reviewed-by: Yu-Ju Hong <yjhong@chromium.org>
Commit-Queue: David James <davidjames@chromium.org>
diff --git a/scripts/cbuildbot.py b/scripts/cbuildbot.py
index 41249f4..632e94e 100644
--- a/scripts/cbuildbot.py
+++ b/scripts/cbuildbot.py
@@ -477,9 +477,25 @@
for x in stage_list]
self._RunParallelStages(stage_objs)
+ def _RunBackgroundStagesForBoardAndMarkAsSuccessful(self, builder_run, board):
+ """Run background board-specific stages for the specified board.
+
+ After finishing the build, mark it as successful.
+
+ Args:
+ builder_run: BuilderRun object for these background stages.
+ board: Board name.
+ """
+ self._RunBackgroundStagesForBoard(builder_run, board)
+ board_runattrs = builder_run.GetBoardRunAttrs(board)
+ board_runattrs.SetParallel('success', True)
+
def _RunBackgroundStagesForBoard(self, builder_run, board):
"""Run background board-specific stages for the specified board.
+ Used by _RunBackgroundStagesForBoardAndMarkAsSuccessful. Callers should use
+ that method instead.
+
Args:
builder_run: BuilderRun object for these background stages.
board: Board name.
@@ -625,7 +641,7 @@
# Set up a process pool to run test/archive stages in the background.
# This process runs task(board) for each board added to the queue.
- task_runner = self._RunBackgroundStagesForBoard
+ task_runner = self._RunBackgroundStagesForBoardAndMarkAsSuccessful
with parallel.BackgroundTaskRunner(task_runner) as queue:
for builder_run, board in tasks:
if not builder_run.config.build_packages_in_background: