Skip to content

service/dap: stop attach fixtures inheriting test stdio - #4415

Open
derekparker wants to merge 1 commit into
go-delve:masterfrom
derekparker:investigate/386-ci-2497
Open

service/dap: stop attach fixtures inheriting test stdio#4415
derekparker wants to merge 1 commit into
go-delve:masterfrom
derekparker:investigate/386-ci-2497

Conversation

@derekparker

Copy link
Copy Markdown
Member

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.

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.
@derekparker
derekparker force-pushed the investigate/386-ci-2497 branch from 248c480 to 3e8581d Compare August 6, 2026 23:43
@derekparker
derekparker marked this pull request as ready for review August 7, 2026 01:26
t.Helper()
// TODO(polina): do I need to sanity check testBackend and runtime.GOOS?
cmd := exec.Command(fixture.Path)
cmd.Stdout = os.Stdout

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I believe it is only present on attach tests because the attach path uses a different kill mechanism (SIGINT vs SIGKILL).

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If we detached properly it shouldn't make any difference. Maybe we are not detaching properly with dap on linux/386?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants