Skip to content

Commit

Permalink
fix Windows build
Browse files Browse the repository at this point in the history
  • Loading branch information
fstab committed May 30, 2019
1 parent 6f55685 commit b4c308b
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions tailer/fswatcher_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -872,19 +872,19 @@ func delete(t *testing.T, ctx *context, file string) {
// os.Remove(file) was successful, the file or directory is gone.
return
} else {
fatalf(t, ctx, "tearDown: %q: stat failed: %v", file, statErr)
err = fmt.Errorf("stat failed: %v", statErr)
}
}
}
// os.Stat() successful. The file or directory is still there. Try again.
time.Sleep(200 * time.Millisecond)
timePassed += 200 * time.Millisecond
}
if runtime.GOOS == "windows" {
// On Windows, removing a watched directory fails with "Access is denied".
// We ignore this here and move on. grok_exporter will never shut down the tailer but
// keep it running until the application terminates, so this should not be a problem.
return
if runtime.GOOS == "windows" {
// On Windows, removing a watched directory fails with "Access is denied".
// We ignore this here and move on. grok_exporter will never shut down the tailer but
// keep it running until the application terminates, so this should not be a problem.
return
}
}
if err != nil {
fatalf(t, ctx, "tearDown: %q: failed to remove file or directory: %v", file, err)
Expand Down

0 comments on commit b4c308b

Please sign in to comment.