Issue Description
When a project uses the <MSBuild> task to build another project (e.g., using BuildInParallel="true" or just calling another project), the current node "yields" execution to the other project. TerminalLogger correctly handles the start of this yield by clearing the node status in TaskStarted("MSBuild") to indicate the node is waiting.
However, TerminalLogger fails to restore the node status when the <MSBuild> task finishes and the node resumes execution. This results in the node's status remaining null for the rest of the project's execution.
This causes:
- "Invisible" nodes in the terminal output (nodes doing work but not showing up in the status bar).
- Potential
NullReferenceExceptions or missing data in other loggers/handlers that rely on the current node status (as seen in the related VSTest reporting issue).
Steps to Reproduce
-
Download and extract the attached Project.zip
-
Run the build using the following command:
msbuild Repro\Main.proj /t:Build /m /tl:on
Expected Behavior
When Leaf.proj finishes and Worker.proj resumes (during the sleep), the terminal status bar should show the Worker node as active (e.g., Worker (Build) (x.xs)).
Actual Behavior
The terminal status bar does not show the Worker node during the sleep phase. The node slot appears empty or is not updated, because the internal state is null.
Analysis
The issue is in TerminalLogger.cs. There is a handler for TaskStarted that clears the node status when e.TaskName == "MSBuild", but there is no corresponding logic in TaskFinished to restore the status from the TerminalProjectInfo.
Issue Description
When a project uses the
<MSBuild>task to build another project (e.g., usingBuildInParallel="true"or just calling another project), the current node "yields" execution to the other project.TerminalLoggercorrectly handles the start of this yield by clearing the node status inTaskStarted("MSBuild")to indicate the node is waiting.However,
TerminalLoggerfails to restore the node status when the<MSBuild>task finishes and the node resumes execution. This results in the node's status remainingnullfor the rest of the project's execution.This causes:
NullReferenceExceptions or missing data in other loggers/handlers that rely on the current node status (as seen in the related VSTest reporting issue).Steps to Reproduce
Download and extract the attached Project.zip
Run the build using the following command:
Expected Behavior
When
Leaf.projfinishes andWorker.projresumes (during the sleep), the terminal status bar should show the Worker node as active (e.g.,Worker (Build) (x.xs)).Actual Behavior
The terminal status bar does not show the Worker node during the sleep phase. The node slot appears empty or is not updated, because the internal state is
null.Analysis
The issue is in
TerminalLogger.cs. There is a handler forTaskStartedthat clears the node status whene.TaskName == "MSBuild", but there is no corresponding logic inTaskFinishedto restore the status from theTerminalProjectInfo.