Skip to content

Commit

Permalink
work around fsnotify issue on Mac (#648)
Browse files Browse the repository at this point in the history
Signed-off-by: spacewander <[email protected]>
  • Loading branch information
spacewander authored Jul 18, 2024
1 parent f9cec7a commit c0b4abd
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion plugins/pkg/file/fs_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ package file

import (
"os"
"runtime"
"sync"
"testing"

Expand All @@ -31,7 +32,13 @@ func TestFileIsChanged(t *testing.T) {

assert.Nil(t, err)

tmpfile, _ := os.CreateTemp("", "example")
var tmpfile *os.File
if runtime.GOOS == "darwin" {
// Work around https://github.com/fsnotify/fsnotify/issues/642
tmpfile, _ = os.CreateTemp("/private/tmp", "example")
} else {
tmpfile, _ = os.CreateTemp("", "example")
}

file := Stat(tmpfile.Name())

Expand Down

0 comments on commit c0b4abd

Please sign in to comment.