Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings
/sysPublic

Commit3cf1e67

Browse files
tklausergopherbot
authored andcommitted
unix: don't fail TestPpoll on EINTR
TestPpoll sometimes fails builders due to Ppoll getting interrupted andreturning EINTR:--- FAIL: TestPpoll (0.00s) syscall_linux_test.go:299: Ppoll: unexpected error: interrupted system callFix this by retrying Ppoll in case of EINTR, same as CL 298189 inTestPoll.Fixesgolang/go#66324Change-Id: I8ce4e2c00fe3b7a078cd75b4b15bb076d3a87fb2Reviewed-on:https://go-review.googlesource.com/c/sys/+/627395Reviewed-by: Cherry Mui <cherryyz@google.com>Reviewed-by: Ian Lance Taylor <iant@google.com>Auto-Submit: Tobias Klauser <tobias.klauser@gmail.com>LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
1 parentd2cea70 commit3cf1e67

File tree

1 file changed

+15
-9
lines changed

1 file changed

+15
-9
lines changed

‎unix/syscall_linux_test.go‎

Lines changed: 15 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -337,15 +337,21 @@ func TestPpoll(t *testing.T) {
337337

338338
fds:= []unix.PollFd{{Fd:int32(f.Fd()),Events:unix.POLLIN}}
339339
timeoutTs:=unix.NsecToTimespec(int64(timeout))
340-
n,err:=unix.Ppoll(fds,&timeoutTs,nil)
341-
ok<-true
342-
iferr!=nil {
343-
t.Errorf("Ppoll: unexpected error: %v",err)
344-
return
345-
}
346-
ifn!=0 {
347-
t.Errorf("Ppoll: wrong number of events: got %v, expected %v",n,0)
348-
return
340+
for {
341+
n,err:=unix.Ppoll(fds,&timeoutTs,nil)
342+
ok<-true
343+
iferr==unix.EINTR {
344+
t.Log("Ppoll interrupted")
345+
continue
346+
}elseiferr!=nil {
347+
t.Errorf("Ppoll: unexpected error: %v",err)
348+
return
349+
}
350+
ifn!=0 {
351+
t.Errorf("Ppoll: wrong number of events: got %v, expected %v",n,0)
352+
return
353+
}
354+
break
349355
}
350356
}
351357

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp