-
Notifications
You must be signed in to change notification settings - Fork 17.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
x/sys/unix: TestEventPortErrors failures #58259
Comments
Found new dashboard test flakes for:
2023-01-31 16:01 illumos-amd64 sys@e7d7f631 go@4fe46cee x/sys/unix.TestEventPortErrors (log)
|
This test is Solaris-specific (attn @golang/solaris @golang/illumos), and was added in CL 324630 and adjusted in CL 422338 (attn @nshalman @tklauser @ianlancetaylor). This test isn't in line with https://go.dev/wiki/CodeReviewComments#useful-test-failures: it doesn't log what actually happened. In particular it would be useful to know what the actual error returned by |
Change https://go.dev/cl/465015 mentions this issue: |
See previously #45643. |
It would really help us if we could get the |
Good point — my apologies for not thinking to add it! |
relates to golang/go#58259 Change-Id: I47bbf4afb59b6e98571297ba53d7f9370712e030 Reviewed-on: https://go-review.googlesource.com/c/sys/+/465015 Reviewed-by: Bryan Mills <bcmills@google.com> Run-TryBot: Ian Lance Taylor <iant@google.com> Auto-Submit: Ian Lance Taylor <iant@google.com> Reviewed-by: Ian Lance Taylor <iant@google.com> TryBot-Result: Gopher Robot <gobot@golang.org>
Per the discussion in https://go.dev/cl/465015 I think the next step is to make the tests handle the syscalls returning EINTR more gracefully. The occurrence reported by the bot isn't the only place where it could happen. Rambling to myself: EDIT to add: That code might get a little verbose, so it might make sense to write one wrapper each for Get and GetOne. |
My current sketch (needs some light commenting, and to be used in all the tests currently calling GetOne...): diff --git a/unix/syscall_solaris_test.go b/unix/syscall_solaris_test.go
index 6c2b906..d79e9fb 100644
--- a/unix/syscall_solaris_test.go
+++ b/unix/syscall_solaris_test.go
@@ -18,6 +18,24 @@ import (
"golang.org/x/sys/unix"
)
+var MAX_EINTR = 10
+
+func getOneRetry(t *testing.T, p *unix.EventPort, timeout *unix.Timespec) (e *unix.PortEvent, err error) {
+ t.Helper()
+ for i := 1; i < MAX_EINTR; i++ {
+ e, err = p.GetOne(timeout)
+ // to exercise the MAX_EINTR uncomment the following line
+ //err = unix.EINTR
+ if err != unix.EINTR {
+ break
+ }
+ }
+ if err != nil {
+ return nil, err
+ }
+ return e, err
+}
+
func TestStatvfs(t *testing.T) {
if err := unix.Statvfs("", nil); err == nil {
t.Fatal(`Statvfs("") expected failure`)
@@ -181,7 +199,7 @@ func TestEventPortErrors(t *testing.T) {
}
timeout := new(unix.Timespec)
timeout.Nsec = 1
- _, err = port.GetOne(timeout)
+ _, err = getOneRetry(t, port, timeout)
if err != unix.ETIME {
// See https://go.dev/issue/58259
// Perhaps we sometimes get EINTR ??? |
Change https://go.dev/cl/465055 mentions this issue: |
Found new dashboard test flakes for:
2023-02-24 13:20 illumos-amd64 sys@92c4c39f go@f76fc28c x/sys/unix.TestEventPortErrors (log)
|
Looks like the improved error message works. Good reminder for me to finish up https://go.dev/cl/465055 |
Issue created automatically to collect these failures.
Example (log):
— watchflakes
The text was updated successfully, but these errors were encountered: