Skip to content

proposal: testing: add pid to -json output #76111

@josharian

Description

@josharian

Proposal Details

I have been playing with test output processors.

The obvious way to run them is:

go test ./... -json | the_test_tool

But the tool now has very little ability to cancel the actual test processes being run. It's all or nothing: close stdin, or don't.

As a result, many such processors want pole position: the_test_tool ./.... That's less ideal, because it doesn't compose nicely; for example, it doesn't play nicely with go test -c.

I propose that when -json is provided, each test process emits a line containing its pid. (Maybe something like "Action": "Info", "PID": 12345?)

Then test tools, particularly interactive test tools, can kill individual test processes as needed.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions