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
The first test TestOutput runs into the test timeout and context timeout is not triggered:
go test -timeout 10s -run Output
Password for 'https://[email protected]': panic: test timed out after 10s
goroutine 7 [running]:
testing.(*M).startAlarm.func1()
...
The second test TestRun works as expected:
Password for 'https://[email protected]': PASSokgit.pnet.ch/golang/pollout3.139s
What did you expect to see?
That for both tests the context timeout of 2 seconds is triggered.
What did you see instead?
Only the second test behaves as expected.
The text was updated successfully, but these errors were encountered:
This is another version of #23019. git is starting a subprocess to read the password, the context timeout only kills the parent process, and the use of CombinedOutput means that the main program hangs waiting for the subprocess to terminate. There is no simple fix here. You can arrange for your main program to not hang by not calling CombinedOutput and using pipes instead, but that won't kill the subprocess.
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?
For the following test:
The first test
TestOutput
runs into the test timeout and context timeout is not triggered:The second test
TestRun
works as expected:What did you expect to see?
That for both tests the context timeout of 2 seconds is triggered.
What did you see instead?
Only the second test behaves as expected.
The text was updated successfully, but these errors were encountered: