From 84943fc8f84fef04cf0a7b7fe7f0abea1e1497f2 Mon Sep 17 00:00:00 2001 From: Klaus Aehlig Date: Wed, 15 Nov 2017 06:27:59 -0800 Subject: UI: show status instead of strategy for non-executing actions Even if an action is planned to run and a strategy assigned, it does not mean it is actually executing; e.g., it might be waiting for local resources. To reduce confusion, show the status instead of the execution strategy for non-executing actions. Also avoid the word "running" for the total number of executing and scheduled to be executed actions. Improves on Issue #4089. Change-Id: If658c1a24ee26eb27ccd892847af18015355a8d3 PiperOrigin-RevId: 175818071 --- .../build/lib/runtime/ExperimentalStateTracker.java | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) (limited to 'src/main/java/com/google/devtools/build/lib/runtime') diff --git a/src/main/java/com/google/devtools/build/lib/runtime/ExperimentalStateTracker.java b/src/main/java/com/google/devtools/build/lib/runtime/ExperimentalStateTracker.java index d03805dbaa..5df6a8dcdb 100644 --- a/src/main/java/com/google/devtools/build/lib/runtime/ExperimentalStateTracker.java +++ b/src/main/java/com/google/devtools/build/lib/runtime/ExperimentalStateTracker.java @@ -245,11 +245,16 @@ class ExperimentalStateTracker { void actionStatusMessage(ActionStatusMessage event) { String strategy = event.getStrategy(); + String name = event.getActionMetadata().getPrimaryOutput().getPath().getPathString(); if (strategy != null) { - String name = event.getActionMetadata().getPrimaryOutput().getPath().getPathString(); synchronized (this) { actionStrategy.put(name, strategy); } + } else { + String message = event.getMessage(); + synchronized (this) { + actionStrategy.put(name, message); + } } } @@ -736,14 +741,14 @@ class ExperimentalStateTracker { terminalWriter.append(";"); } if (runningActions.size() == 0) { - terminalWriter.normal().append(" no action running"); + terminalWriter.normal().append(" no action"); maybeShowRecentTest(terminalWriter, shortVersion, targetWidth - terminalWriter.getPosition()); } else if (runningActions.size() == 1) { if (maybeShowRecentTest(null, shortVersion, targetWidth - terminalWriter.getPosition())) { // As we will break lines anyway, also show the number of running actions, to keep // things stay roughly in the same place (also compensating for the missing plural-s // in the word action). - terminalWriter.normal().append(" 1 action running"); + terminalWriter.normal().append(" 1 action"); maybeShowRecentTest( terminalWriter, shortVersion, targetWidth - terminalWriter.getPosition()); String statusMessage = @@ -766,10 +771,10 @@ class ExperimentalStateTracker { clock.nanoTime(), targetWidth - terminalWriter.getPosition(), null); - statusMessage += " ... (" + runningActions.size() + " actions running)"; + statusMessage += " ... (" + runningActions.size() + " actions)"; terminalWriter.normal().append(" " + statusMessage); } else { - String statusMessage = "" + runningActions.size() + " actions running"; + String statusMessage = "" + runningActions.size() + " actions"; terminalWriter.normal().append(" " + statusMessage); maybeShowRecentTest( terminalWriter, shortVersion, targetWidth - terminalWriter.getPosition()); -- cgit v1.2.3