-
Notifications
You must be signed in to change notification settings - Fork 17.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
cmd/dist: flush incomplete lines in -json mode
Currently, if a test prints an incomplete line and then exits, in JSON mode, the filter we use to rewrite Package lines will keep the last incomplete line in an internal buffer and never print it. In theory this should never happen anyway because the test should only write JSON to stdout, but we try pretty hard to pass through any non-JSON, so it seems inconsistent to swallow incomplete lines. Fix this by adding a testJSONFilter.Flush method and calling it in the right places. Unfortunately this is a bit tricky because the filter is constructed pretty far from where we run the exec.Cmd, so we return the flush function through the various layers in order to route it to the place where we call Cmd.Run. Updates #37486. Change-Id: I38af67e8ad23458598a32fd428779bb0ec21ac3c Reviewed-on: https://go-review.googlesource.com/c/go/+/496516 Run-TryBot: Austin Clements <austin@google.com> TryBot-Result: Gopher Robot <gobot@golang.org> Auto-Submit: Austin Clements <austin@google.com> Reviewed-by: Bryan Mills <bcmills@google.com>
- Loading branch information
Showing
3 changed files
with
35 additions
and
13 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters