aboutsummaryrefslogtreecommitdiff
path: root/misc
diff options
context:
space:
mode:
Diffstat (limited to 'misc')
-rw-r--r--misc/cgo/test/issue1435.go21
1 files changed, 17 insertions, 4 deletions
diff --git a/misc/cgo/test/issue1435.go b/misc/cgo/test/issue1435.go
index cf34ce8db6..92c6b99846 100644
--- a/misc/cgo/test/issue1435.go
+++ b/misc/cgo/test/issue1435.go
@@ -9,6 +9,7 @@ package cgotest
import (
"fmt"
"os"
+ "sort"
"strings"
"syscall"
"testing"
@@ -105,11 +106,23 @@ func compareStatus(filter, expect string) error {
// "Pid:\t".
}
if strings.HasPrefix(line, filter) {
- if line != expected {
- return fmt.Errorf("%q got:%q want:%q (bad) [pid=%d file:'%s' %v]\n", tf, line, expected, pid, string(d), expectedProc)
+ if line == expected {
+ foundAThread = true
+ break
+ }
+ if filter == "Groups:" && strings.HasPrefix(line, "Groups:\t") {
+ // https://github.com/golang/go/issues/46145
+ // Containers don't reliably output this line in sorted order so manually sort and compare that.
+ a := strings.Split(line[8:], " ")
+ sort.Strings(a)
+ got := strings.Join(a, " ")
+ if got == expected[8:] {
+ foundAThread = true
+ break
+ }
+
}
- foundAThread = true
- break
+ return fmt.Errorf("%q got:%q want:%q (bad) [pid=%d file:'%s' %v]\n", tf, line, expected, pid, string(d), expectedProc)
}
}
}