hpcloud / tail

Go package for reading from continously updated files (tail -f)
MIT License
2.71k stars 503 forks source link

Failed test under macOS #111

Closed pyed closed 7 years ago

pyed commented 7 years ago

running Go 1.8 under macOS Sierra 10.12.3 (16D32), HEAD at faf842bde7ed83bbc3c65a2c454fae39bc29a95f

~/.../hpcloud/tail $ go test
2017/02/23 23:27:19 Waiting for /no/such/file to appear...
2017/02/23 23:27:19 Waiting for .test/waits-for-file-to-exist/test.txt to appear...
2017/02/23 23:27:19 Waiting for test.txt to appear...
2017/02/23 23:27:20 Waiting for _no_such_file to appear...
2017/02/23 23:27:20 Seeked .test/location-end/test.txt - &{Offset:0 Whence:2}
2017/02/23 23:27:20 Seeked .test/location-middle/test.txt - &{Offset:-6 Whence:2}
2017/02/23 23:27:21 Re-opening moved/deleted file .test/reopen-inotify/test.txt ...
2017/02/23 23:27:21 Waiting for .test/reopen-inotify/test.txt to appear...
2017/02/23 23:27:22 Re-opening moved/deleted file .test/reopen-polling/test.txt ...
2017/02/23 23:27:22 Waiting for .test/reopen-polling/test.txt to appear...
2017/02/23 23:27:22 Successfully reopened .test/reopen-polling/test.txt
2017/02/23 23:27:22 Re-opening moved/deleted file .test/reopen-polling/test.txt ...
2017/02/23 23:27:22 Waiting for .test/reopen-polling/test.txt to appear...
2017/02/23 23:27:23 Successfully reopened .test/reopen-polling/test.txt
2017/02/23 23:27:23 Re-opening moved/deleted file .test/reopen-polling/test.txt ...
2017/02/23 23:27:23 Waiting for .test/reopen-polling/test.txt to appear...
2017/02/23 23:27:23 Stopping tail as file no longer exists: .test/reseek-inotify/test.txt
--- FAIL: TestReSeekInotify (0.20s)
    tail_test.go:499: tail ended early; expecting more: [h311o w0r1d endofworld]
2017/02/23 23:27:23 Re-opening truncated file .test/reseek-polling/test.txt ...
2017/02/23 23:27:23 Successfully reopened truncated .test/reseek-polling/test.txt
2017/02/23 23:27:24 Leaky bucket full (.test/rate-limiting/test.txt); entering 1s cooloff period.
2017/02/23 23:27:24 Stopping tail as file no longer exists: .test/reseek-polling/test.txt
2017/02/23 23:27:25 Leaky bucket full (.test/rate-limiting/test.txt); entering 1s cooloff period.
2017/02/23 23:27:25 Seeked .test/tell-position/test.txt - &{Offset:0 Whence:0}
2017/02/23 23:27:25 Seeked .test/tell-position/test.txt - &{Offset:12 Whence:0}
2017/02/23 23:27:25 Waiting for .test/block-until-file-exists/test.txt to appear...
FAIL
exit status 1
FAIL    github.com/hpcloud/tail 5.565s
xuzixx commented 7 years ago

I get the same test result. I think osx should use "Poll for file changes instead of using inotify"

pyed commented 7 years ago

v1.0.0 tag's tests do pass, so the breaking change was introduced after that.

xuzixx commented 7 years ago

112 @TerraTech I change some logic of your commit. I think it will have the same result( #101 ). Please review.

TerraTech commented 7 years ago

@xuzixx LGTM, all tests passed on my Linux system