Skip to content

TestNewBinaryIOCleanup failing on gotip #10345

@mauri870

Description

@mauri870

Description

Noticed that there is a test failure on gotip (future Go 1.23):

=== RUN   TestNewBinaryIOCleanup
    io_test.go:64: some descriptors weren't closed (7 != 8)
--- FAIL: TestNewBinaryIOCleanup (0.00s)
FAIL
FAIL    github.com/containerd/containerd/v2/cmd/containerd-shim-runc-v2/process 0.003s
FAIL

This happens because 1.23 will make use of pidfd on Linux, see golang/go#62654.

The test thinks that this file descriptor is leaking. The solution is pretty simple, it needs to ignore a file descriptor that is pidfd.

This is a hacky way to ignore file descriptors internal to the runtime, there is a proposal open at golang/go#67639 that should provide a better way to detect leaking fds.

Steps to reproduce the issue

$ go install golang.org/dl/gotip@latest
$ gotip download
$ gotip test -v ./cmd/containerd-shim-runc-v2/process -run=TestNewBinaryIOCleanup

Describe the results you received and expected

Test fails. It should pass and continue to work on 1.21 and 1.22 as well.

What version of containerd are you using?

tip

Any other relevant information

No response

Show configuration if it is related to CRI plugin.

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions