Skip to content

Commit

Permalink
Remove EINTR from the test cases (handled at syscall layer)
Browse files Browse the repository at this point in the history
Signed-off-by: Edoardo Vacchi <[email protected]>
  • Loading branch information
evacchi committed Aug 2, 2023
1 parent c2697a5 commit 1591692
Showing 1 changed file with 0 additions and 13 deletions.
13 changes: 0 additions & 13 deletions internal/sysfs/poll_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,18 +8,13 @@ import (
"testing"
"time"

"github.com/tetratelabs/wazero/experimental/sys"
"github.com/tetratelabs/wazero/internal/testing/require"
)

func Test_poll(t *testing.T) {
t.Run("should return immediately with no fds and duration 0", func(t *testing.T) {
for {
n, err := _poll([]pollFd{}, 0)
if err == sys.EINTR {
t.Logf("Select interrupted")
continue
}
require.EqualErrno(t, 0, err)
require.Equal(t, 0, n)
return
Expand All @@ -37,10 +32,6 @@ func Test_poll(t *testing.T) {
start := time.Now()
n, err := _poll([]pollFd{}, dur)
took = time.Since(start)
if err == sys.EINTR {
t.Logf("Select interrupted after %v", took)
continue
}
require.EqualErrno(t, 0, err)
require.Equal(t, 0, n)

Expand Down Expand Up @@ -72,10 +63,6 @@ func Test_poll(t *testing.T) {

for {
fds := []pollFd{newPollFd(rr.Fd(), _POLLIN, 0)}
if err == sys.EINTR {
t.Log("Select interrupted")
continue
}
n, err := _poll(fds, 0)
require.EqualErrno(t, 0, err)
require.Equal(t, 1, n)
Expand Down

0 comments on commit 1591692

Please sign in to comment.