You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I don't think I'd classify this as a bug but in my opinion, it does represent undesirable behavior. Running the following test under different conditions result in different outcomes, which may represent a difference in the actual characters emitted to the output:
// Write both to stdout and buf, for possible saving
// to cache, and for looking for the "no tests to run" message.
stdout=io.MultiWriter(stdout, &buf)
} else {
stdout=&buf
}
}
and as noted in the comment, has been around longer since at least Go 1.5 (since the special case was added at that point). I'm not arguing that there's a need for the buffering in some cases and that it's safe to write directly to stdout in other cases but rather that the test environment should remain consistent regardless of how the test is launched.
Since there's the need for buffering in some cases, it's impossible for stdout to always be a *unix.Termios. I'd argue that (during tests), stdout should therefore NEVER be a *unix.Termios.
The text was updated successfully, but these errors were encountered:
What version of Go are you using (
go version
)?Does this issue reproduce with the latest release?
Yes
What operating system and processor architecture are you using (
go env
)?go env
OutputWhat did you do?
I don't think I'd classify this as a bug but in my opinion, it does represent undesirable behavior. Running the following test under different conditions result in different outcomes, which may represent a difference in the actual characters emitted to the output:
What did you expect to see?
The same output to
stdout
regardless of the command that ran the test.What did you see instead?
Assuming this test is placed in a sub-package, the outcome of this test is as follows:
go test -v -bench=. ./...
cd pkg/output && go test -v
go test -v ./pkg/output
This behavior is caused by the code at
go/src/cmd/go/internal/test/test.go
Lines 1180 to 1208 in f721fa3
stdout
in other cases but rather that the test environment should remain consistent regardless of how the test is launched.Since there's the need for buffering in some cases, it's impossible for
stdout
to always be a*unix.Termios
. I'd argue that (during tests),stdout
should therefore NEVER be a*unix.Termios
.The text was updated successfully, but these errors were encountered: