Skip to content
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

Fix TestInotifyOverflow #265

Merged
merged 1 commit into from Aug 30, 2018
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
6 changes: 6 additions & 0 deletions inotify_test.go
Expand Up @@ -11,6 +11,7 @@ import (
"os"
"path/filepath"
"strings"
"sync"
"testing"
"time"
)
Expand Down Expand Up @@ -390,9 +391,12 @@ func TestInotifyOverflow(t *testing.T) {

errChan := make(chan error, numDirs*numFiles)

// All events need to be in the inotify queue before pulling events off it to trigger this error.
wg := sync.WaitGroup{}
for dn := 0; dn < numDirs; dn++ {
testSubdir := fmt.Sprintf("%s/%d", testDir, dn)

wg.Add(1)
go func() {
for fn := 0; fn < numFiles; fn++ {
testFile := fmt.Sprintf("%s/%d", testSubdir, fn)
Expand All @@ -409,8 +413,10 @@ func TestInotifyOverflow(t *testing.T) {
continue
}
}
wg.Done()
}()
}
wg.Wait()

creates := 0
overflows := 0
Expand Down