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 88 "os/exec"
99 "path/filepath"
1010 "reflect"
11+ "slices"
1112 "strconv"
1213 "strings"
1314 "syscall"
@@ -1694,7 +1695,11 @@ func fdList(t *testing.T) []string {
16941695 fds , err := fdDir .Readdirnames (- 1 )
16951696 ok (t , err )
16961697
1697- return fds
1698+ // Remove the fdDir fd.
1699+ extraFd := strconv .Itoa (int (fdDir .Fd ()))
1700+ return slices .DeleteFunc (fds , func (fd string ) bool {
1701+ return fd == extraFd
1702+ })
16981703}
16991704
17001705func testFdLeaks (t * testing.T , systemd bool ) {
@@ -1716,7 +1721,7 @@ func testFdLeaks(t *testing.T, systemd bool) {
17161721 runContainerOk (t , config , "true" )
17171722 fds1 := fdList (t )
17181723
1719- if reflect . DeepEqual (fds0 , fds1 ) {
1724+ if slices . Equal (fds0 , fds1 ) {
17201725 return
17211726 }
17221727 // Show the extra opened files.
You can’t perform that action at this time.
0 commit comments