service/dap: stop attach fixtures inheriting test stdio - #4415
service/dap: stop attach fixtures inheriting test stdio#4415derekparker wants to merge 1 commit into
Conversation
Fixture processes that inherit os.Stdout/os.Stderr keep go test's pipes open after the package exits, causing flaky WaitDelay / "Test I/O incomplete" failures (seen on linux/386 CI). Discard fixture stdio by default, Kill+Wait on cleanup, and route attach tests that need stdout through a pipe helper.
248c480 to
3e8581d
Compare
| t.Helper() | ||
| // TODO(polina): do I need to sanity check testBackend and runtime.GOOS? | ||
| cmd := exec.Command(fixture.Path) | ||
| cmd.Stdout = os.Stdout |
There was a problem hiding this comment.
Seeing the stdout and stderr is useful for debugging in some cases. Besides passing os.Stdout and os.Stderr is what we do in every other case anyway in pkg/proc/native/proc_linux.go.
It can't be that this is the problem and if it was it would happen on all linux platforms, not just on linux/386.
There was a problem hiding this comment.
So what lead me here is failures such as https://delve.teamcity.com/buildConfiguration/Delve_linux_386_1_27/80319?logFilter=debug&logView=flowAware&showLog=80319_57096_582.
PASS
*** Test I/O incomplete 1m0s after exiting.
exec: WaitDelay expired before I/O complete
FAIL github.com/go-delve/delve/service/dap 153.394s
So something along these lines is causing intermittent failures in CI.
There was a problem hiding this comment.
It could be any of the tests that's doing this, they all give stdout and stderr to a child process. If we print the output of ps aux at the end of TestMain maybe we can manage to narrow it down.
There was a problem hiding this comment.
I believe it is only present on attach tests because the attach path uses a different kill mechanism (SIGINT vs SIGKILL).
There was a problem hiding this comment.
If we detached properly it shouldn't make any difference. Maybe we are not detaching properly with dap on linux/386?
Fixture processes that inherit os.Stdout/os.Stderr keep go test's pipes open after the package exits, causing flaky WaitDelay / "Test I/O incomplete" failures (seen on linux/386 CI). Discard fixture stdio by default, Kill+Wait on cleanup, and route attach tests that need stdout through a pipe helper.