File tree Expand file tree Collapse file tree 1 file changed +7
-2
lines changed
Expand file tree Collapse file tree 1 file changed +7
-2
lines changed Original file line number Diff line number Diff line change 99 "os/exec"
1010 "path/filepath"
1111 "reflect"
12+ "slices"
1213 "strconv"
1314 "strings"
1415 "syscall"
@@ -1704,7 +1705,11 @@ func fdList(t *testing.T) []string {
17041705 fds , err := fdDir .Readdirnames (- 1 )
17051706 ok (t , err )
17061707
1707- return fds
1708+ // Remove the fdDir fd.
1709+ extraFd := strconv .Itoa (int (fdDir .Fd ()))
1710+ return slices .DeleteFunc (fds , func (fd string ) bool {
1711+ return fd == extraFd
1712+ })
17081713}
17091714
17101715func testFdLeaks (t * testing.T , systemd bool ) {
@@ -1726,7 +1731,7 @@ func testFdLeaks(t *testing.T, systemd bool) {
17261731 _ = runContainerOk (t , config , "true" )
17271732 fds1 := fdList (t )
17281733
1729- if reflect . DeepEqual (fds0 , fds1 ) {
1734+ if slices . Equal (fds0 , fds1 ) {
17301735 return
17311736 }
17321737 // Show the extra opened files.
You can’t perform that action at this time.
0 commit comments