-
Notifications
You must be signed in to change notification settings - Fork 40
Tests run twice #6
Comments
It's possible it's getting two events. Are you saving one *.go file? May be related to atomic saves. I'll see if I can reproduce it. It may be necessary to add some throttling now that any change tests the entire package. |
@darkhelmet I'm going to need more info to reproduce this issue. Steps to reproduce, yo? |
I'm using my
|
Saving from Sublime Text? (v 2.0.1)? What settings are you using for saving? Gofmt, etc.? I pulled your repo and wasn't able to reproduce it. I should probably add a --debug option to log what's coming from the watcher. I know prettytest has a bunch of code to throttle the watcher, but this is the first time I've seen a need for it. Your computer must be smoking fast! :-) |
I wonder if it's gofmt running. There would be the save, then gofmt... On Sun, Jun 23, 2013 at 10:52 PM, Nathan Youngman
|
@darkhelmet Can you try looper 0.2.1 with I noticed I'm getting new file events when I expected change file events here. |
I get Even turning off |
~/dev/go/src/github.com/darkhelmet/blargh (master) » looper -debug
Looper 0.2.1 is watching your files
Type help for help.
Debug mode enabled.
Watching path ./
Watching path errors
Watching path filerepo
Watching path filerepo/test
Watching path filerepo/test/repo
Watching path filerepo/test/sort
Watching path html
Watching path html/atom
Watching path html/testdata
Watching path html/testdata/webkit
Watching path html/testdata/webkit/scripted
Watching path post
Watching path post/test
Detected file modification post/post.go
go test ./post
Detected file modification post/post.go
ok github.com/darkhelmet/blargh/post 0.057s
PASS (0.58 seconds)
go test ./post
ok github.com/darkhelmet/blargh/post 0.056s
PASS (0.56 seconds) |
Hm. That doesn't tell us much. Guess I just need some throttling in place. Is the fsnotify package up-to-date on your computer? |
I installed with -u -v and I believe I remember it updating that package. On Mon, Jul 8, 2013 at 11:27 PM, Nathan Youngman [email protected]
|
Before adding some sort of throttling to my RecursiveWatcher, I emailed @howeyc to see if this is something that can be resolved in fsnotify or if I just made a dumb mistake in my use of it. |
For some reason this is happening to me now, which will make it a lot easier to debug. @howeyc didn't feel that a ThrottledWatcher belonged in fsnotify proper, but I'm starting work on a fsnotify-ext package. |
Started on https://github.com/gophertown/fsnotify_ext, but still a lot to do! |
@darkhelmet I have an open pull request to throttle events in fsnotify howeyc/fsnotify#65. Testing it out with Looper now. |
It has been pointed out that this is caused by Spotlight. howeyc/fsnotify#62 One solution is to add your development folder to the Spotlight Privacy settings, at least until we have a better option. |
Related issue: running the tests for |
My tests run three times currently from vim (lucky me) on OSX whenever I save a change. Would it be worth ignoring a small window of file notification activity when receiving a change event to avoid this? (like 50/100 ms?) |
That might work. Hugo has something like that in place. I'm not a vim user, but besides modifying Spotlight Privacy settings (mentioned above), you could also try tweaking your .vimrc file. These settings are from thoughtbot's config
|
Thx @nathany. Modifying the vim config dropped one of the three. Adding the project folder to Spotify Privacy didn't seem to have any effect. |
Progress. This is Hugo's code to batch up notifications. Not sure when I'll get a chance to implement it, but I'd welcome a pull request. 😉 https://github.com/spf13/hugo/blob/master/watcher/batcher.go |
Not that it's slow, but when I make a simple change, it runs the tests twice. How does software even work?
The text was updated successfully, but these errors were encountered: