powerman / tail

Go package tail implements behaviour of `tail -F` to follow rotated log files

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

TestFIFOGrow test deadlocks on macos

mkmik opened this issue · comments

Reproduce with:

$ uname
Darwin
$ go test ./... -v -run TestFIFOGrow --timeout=60s
=== RUN   TestFIFOGrow
=== PAUSE TestFIFOGrow
=== CONT  TestFIFOGrow
panic: test timed out after 1m0s

goroutine 33 [running]:
testing.(*M).startAlarm.func1()
	/usr/local/Cellar/go/1.18/libexec/src/testing/testing.go:2029 +0x8e
created by time.goFunc
	/usr/local/Cellar/go/1.18/libexec/src/time/sleep.go:176 +0x32

goroutine 1 [chan receive]:
testing.tRunner.func1()
	/usr/local/Cellar/go/1.18/libexec/src/testing/testing.go:1405 +0x4a5
testing.tRunner(0xc00011b040, 0xc00014fc80)
	/usr/local/Cellar/go/1.18/libexec/src/testing/testing.go:1445 +0x13b
testing.runTests(0xc000130820?, {0x14b98a0, 0x12, 0x12}, {0x12bf35c?, 0xf?, 0x14be620?})
	/usr/local/Cellar/go/1.18/libexec/src/testing/testing.go:1837 +0x457
testing.(*M).Run(0xc000130820)
	/usr/local/Cellar/go/1.18/libexec/src/testing/testing.go:1719 +0x5d9
github.com/powerman/check.TestMain(0x1590a68?)
	/Users/mkm/go/pkg/mod/github.com/powerman/check@v1.4.0/stats.go:103 +0x19
github.com/powerman/tail.TestMain(...)
	/Users/mkm/Projects/p/tail/init_test.go:251
main.main()
	_testmain.go:87 +0x1d4

goroutine 18 [select]:
github.com/powerman/tail.(*testTail).Close(0xc00018c000)
	/Users/mkm/Projects/p/tail/init_test.go:83 +0xa6
github.com/powerman/tail.TestFIFOGrow(0xc00011b1e0)
	/Users/mkm/Projects/p/tail/tail_test.go:150 +0x163
testing.tRunner(0xc00011b1e0, 0x12cd2b8)
	/usr/local/Cellar/go/1.18/libexec/src/testing/testing.go:1439 +0x102
created by testing.(*T).Run
	/usr/local/Cellar/go/1.18/libexec/src/testing/testing.go:1486 +0x35f

goroutine 20 [syscall]:
syscall.syscall(0xc000172190?, 0xc000172190?, 0x800000?, 0x7ffff800000?)
	/usr/local/Cellar/go/1.18/libexec/src/runtime/sys_darwin.go:22 +0x4e
syscall.read(0xc0001183c0?, {0xc000090040?, 0xc000104da8?, 0x1240bad?})
	/usr/local/Cellar/go/1.18/libexec/src/syscall/zsyscall_darwin_amd64.go:1189 +0x49
syscall.Read(...)
	/usr/local/Cellar/go/1.18/libexec/src/syscall/syscall_unix.go:188
internal/poll.ignoringEINTRIO(...)
	/usr/local/Cellar/go/1.18/libexec/src/internal/poll/fd_unix.go:794
internal/poll.(*FD).Read(0xc0001183c0?, {0xc000090040?, 0x8?, 0x8?})
	/usr/local/Cellar/go/1.18/libexec/src/internal/poll/fd_unix.go:163 +0x285
os.(*File).read(...)
	/usr/local/Cellar/go/1.18/libexec/src/os/file_posix.go:31
os.(*File).Read(0xc000116080, {0xc000090040?, 0x1054fa5?, 0xc000022500?})
	/usr/local/Cellar/go/1.18/libexec/src/os/file.go:119 +0x5e
github.com/powerman/tail.(*Tail).read(0xc000156f50, 0xc00008e1e0, {0xc000090040, 0x8, 0x8})
	/Users/mkm/Projects/p/tail/tail.go:146 +0x8d
github.com/powerman/tail.(*Tail).Read(0xc000156f50, {0xc000090040, 0x8, 0x8})
	/Users/mkm/Projects/p/tail/tail.go:106 +0x1d6
github.com/powerman/tail.(*testTail).reader(0xc00018c000)
	/Users/mkm/Projects/p/tail/init_test.go:102 +0x58
created by github.com/powerman/tail.(*testTail).Run
	/Users/mkm/Projects/p/tail/init_test.go:71 +0x2aa
FAIL	github.com/powerman/tail	60.016s
FAIL

Sorry, I don't have a Mac, and this doesn't happens on Linux, so you'll have to fix it yourself or wait for a someone with an access to Mac to fix it for you. 😞

yep, I'll try to fix that or find a way to reproduce it on linux