lib/fs: Fix and update error about inotify watch limit (fixes #4833) (#4835)

This commit is contained in:
Simon Frei
2018-03-23 12:56:38 +01:00
committed by Jakob Borg
parent e7dc2f9190
commit da3b38ccce
4 changed files with 39 additions and 26 deletions

View File

@@ -7,14 +7,12 @@
package fs
import (
"errors"
"io/ioutil"
"os"
"path/filepath"
"runtime"
"sort"
"strings"
"syscall"
"testing"
"time"
)
@@ -483,23 +481,3 @@ func TestRooted(t *testing.T) {
}
}
}
func TestWatchErrorLinuxInterpretation(t *testing.T) {
if runtime.GOOS != "linux" {
t.Skip("testing of linux specific error codes")
}
var errTooManyFiles syscall.Errno = 24
var errNoSpace syscall.Errno = 28
if !reachedMaxUserWatches(errTooManyFiles) {
t.Errorf("Errno %v should be recognised to be about inotify limits.", errTooManyFiles)
}
if !reachedMaxUserWatches(errNoSpace) {
t.Errorf("Errno %v should be recognised to be about inotify limits.", errNoSpace)
}
err := errors.New("Another error")
if reachedMaxUserWatches(err) {
t.Errorf("This error does not concern inotify limits: %#v", err)
}
}