From 8ef73c5dd50e89a7c2fdb92343e11be77660510a Mon Sep 17 00:00:00 2001 From: Shengjing Zhu Date: Thu, 8 Aug 2024 17:20:03 +0800 Subject: [PATCH] Fix TestNewBinaryIOCleanup on Go 1.23 and Linux 5.4 When running the test on Ubuntu focal (kernel version 5.4), the symlink for pidfd is anon_inode:[pidfd]. Updates: #10345 Signed-off-by: Shengjing Zhu --- cmd/containerd-shim-runc-v2/process/io_test.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/cmd/containerd-shim-runc-v2/process/io_test.go b/cmd/containerd-shim-runc-v2/process/io_test.go index 0ec423002..958fad10e 100644 --- a/cmd/containerd-shim-runc-v2/process/io_test.go +++ b/cmd/containerd-shim-runc-v2/process/io_test.go @@ -88,7 +88,8 @@ func descriptorCount(t *testing.T) int { continue } - if strings.HasPrefix(sym, "pidfd:") { + if strings.Contains(sym, "pidfd") { + // Either pidfd:[70517] or anon_inode:[pidfd] (on Linux 5.4) files = append(files[:i], files[i+1:]...) } }