Closed ZekeLu closed 2 years ago
Change https://go.dev/cl/435735 mentions this issue: os/signal: disable GUN readline to deflake TestTerminalSignal
@gopherbot, please add labels Testing and remove label compiler/runtime
CC @golang/runtime.
Is this the same cause as #37329 (and thus the CL fixes that)?
It's unlikely that this CL will fix #37329. I will comment there.
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 have
~/.inputrc
with this content:And run the test on tip:
Note: I don't find an easy way to disable the test cache. I ended up add
"-v", "-count=1"
toargs
(the-v
option helps revealing the abnormal behavior of the GNU readline library in the later section):https://github.com/golang/go/blob/a48fc816e703989b54845c5ce557c54a45cbfe9c/src/cmd/dist/test.go#L402-L407
What did you expect to see?
The tests pass.
What did you see instead?
What's wrong?
Now remove
~/.inputrc
and rungotip tool dist test go_test:os/signal
(which./run.bash
calls):Comparing to the output of
gotip test ./os/signal -v -count 1 -run ^TestTerminalSignal$
:Even though both tests passed, the first one has shown something abnormal (see the highlighted lines in the output). Since
go tool dist test
does not pass-v
togo test
, we haven't noticed that. And when a special~/.inputrc
file is used, the abnormal behavior of readline finally fails the test.I still don't understand why the GNU readline library works correctly when
TestTerminalSignal
is run bygo test
directly, but behaves abnormally whengo test
is called bygo tool dist test
. But the fix is easy, we just need to disable it with the bash option--noediting
. CL coming soon.