mirror of
https://github.com/netbirdio/gvisor.git
synced 2026-05-22 17:12:49 -07:00
Deflake TestProcfsDump.
The sleep process in the container may have other open FDs to SO files. So just check for stdout, stderr, stdin. PiperOrigin-RevId: 452847291
This commit is contained in:
@@ -370,11 +370,11 @@ func TestProcfsDump(t *testing.T) {
|
||||
t.Errorf("expected CWD %q, got %q", spec.Process.Cwd, procfsDump[0].CWD)
|
||||
}
|
||||
|
||||
// Expect 3 host FDs for stdout, stdin and stderr.
|
||||
if len(procfsDump[0].FDs) != 3 {
|
||||
t.Errorf("expected 3 FDs for the sleep process, got %+v", procfsDump[0].FDs)
|
||||
// Expect at least 3 host FDs for stdout, stdin and stderr.
|
||||
if len(procfsDump[0].FDs) < 3 {
|
||||
t.Errorf("expected at least 3 FDs for the sleep process, got %+v", procfsDump[0].FDs)
|
||||
} else {
|
||||
for i, fd := range procfsDump[0].FDs {
|
||||
for i, fd := range procfsDump[0].FDs[:3] {
|
||||
if want := int32(i); fd.Number != want {
|
||||
t.Errorf("expected FD number %d, got %d", want, fd.Number)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user