Skip to content

[1.3] libct/int: TestFdLeaks: deflake#5042

Merged
kolyshkin merged 1 commit into
opencontainers:release-1.3from
lifubang:backport-5014-fd-leaks-flake-1.3
Nov 27, 2025
Merged

[1.3] libct/int: TestFdLeaks: deflake#5042
kolyshkin merged 1 commit into
opencontainers:release-1.3from
lifubang:backport-5014-fd-leaks-flake-1.3

Conversation

@lifubang
Copy link
Copy Markdown
Member

backport #5014


Since the recent CVE fixes, TestFdLeaksSystemd sometimes fails:

=== RUN   TestFdLeaksSystemd
    exec_test.go:1750: extra fd 9 -> /12224/task/13831/fd
    exec_test.go:1753: found 1 extra fds after container.Run
--- FAIL: TestFdLeaksSystemd (0.10s)

It might have been caused by the change to the test code in commit ff6fe13 ("utils: use safe procfs for /proc/self/fd loop code") -- we are now opening a file descriptor during the logic to get a list of file descriptors. If the file descriptor happens to be allocated to a different number, you'll get an error.

Let's try to filter out the fd used to read a directory.

(cherry picked from commit 5fbc3bb)

Since the recent CVE fixes, TestFdLeaksSystemd sometimes fails:

	=== RUN   TestFdLeaksSystemd
	    exec_test.go:1750: extra fd 9 -> /12224/task/13831/fd
	    exec_test.go:1753: found 1 extra fds after container.Run
	--- FAIL: TestFdLeaksSystemd (0.10s)

It might have been caused by the change to the test code in commit
ff6fe13 ("utils: use safe procfs for /proc/self/fd loop code") -- we are
now opening a file descriptor during the logic to get a list of file
descriptors. If the file descriptor happens to be allocated to a
different number, you'll get an error.

Let's try to filter out the fd used to read a directory.

Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
(cherry picked from commit 5fbc3bb)
Signed-off-by: lifubang <lifubang@acmcoder.com>
@lifubang lifubang added area/ci backport/1.3-pr A backport PR to release-1.3 labels Nov 26, 2025
@lifubang lifubang mentioned this pull request Nov 26, 2025
@kolyshkin kolyshkin merged commit 2e68e04 into opencontainers:release-1.3 Nov 27, 2025
37 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/ci backport/1.3-pr A backport PR to release-1.3

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants