Skip to content

Commit

Permalink
Replace "checking cached actions" message when no action is running.
Browse files Browse the repository at this point in the history
While we delay the execution phase progress until we execution real actions (see unknown commit), with Skymeld we could still see the following scenario:
- Bazel completes the analysis for the first top-level target
- Bazel starts execution for the first top-level target, still analyzing other top-level targets
- Bazel completes execution for the first top-level target, still running analysis for other top-level targets

Prior to this CL, we would have reported something like `[42 / 42] checking cached actions` until we continue with execution (after the next top-level target finishes analysis). Now, we do report `[42 / 42] no actions running`.

RELNOTES: Improve progress message in case there are no actions in flight, and display explicitly "no actions running" in that case.
PiperOrigin-RevId: 661205481
Change-Id: Ieaf77090ecf3d4979330fcd8229a92afc98c7557
  • Loading branch information
meisterT authored and copybara-github committed Aug 9, 2024
1 parent 9948654 commit b215cb8
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -242,4 +242,8 @@ public void maybeReportInactivity() {
}
};
}

public boolean hasActionsInFlight() {
return completedActions.size() < exclusiveTestsCount + enqueuedActions.size();
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -1284,7 +1284,11 @@ protected void writeExecutionProgress(
ActionState oldestAction = getOldestAction();
if (actionsCount == 0 || oldestAction == null) {
// TODO(b/239693084): Improve the message here.
terminalWriter.normal().append(" checking cached actions");
if (executionProgressReceiver != null && executionProgressReceiver.hasActionsInFlight()) {
terminalWriter.normal().append(" checking cached actions");
} else {
terminalWriter.normal().append(" no actions running");
}
maybeShowRecentTest(terminalWriter, shortVersion, targetWidth - terminalWriter.getPosition());
} else if (actionsCount == 1) {
if (maybeShowRecentTest(null, shortVersion, targetWidth - terminalWriter.getPosition())) {
Expand Down

2 comments on commit b215cb8

@fmeum
Copy link
Collaborator

@fmeum fmeum commented on b215cb8 Aug 9, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@iancha1992 This would also be great to get into 7.4.0.

@iancha1992
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@iancha1992 This would also be great to get into 7.4.0.

Sure! I'll put this on my todo list. We plan to cut the branch for 7.4.0 on Monday. So I'll do it then. Thanks.

Please sign in to comment.