`go test -v` fails on Windows. Unix-only syscalls on consumer_test.go
kataras opened this issue · 4 comments
I have to say that I am really impressed, good job @mcmathja. The package is well-written with documentation and easy-to-understand code flow. You use the Go Best Practices. I am feeling that you will shine among go community, keep up the great work. You've got my star :)
Now, on consumer_test.go
you use syscalls that are only available on unix systems and not windows, you have two options:
- Add
// +build !windows
to ignore building on Windows onconsumer_test.go
(not recommended) - Replace all
syscall.Kill
and remove allsyscall.SIGUSR1
from your tests code.
Here is the output I got when running go test -v
on my windows 10 machine.
C:\mygopath\src\github.com\mcmathja\curlyq>go test -v
# github.com/mcmathja/curlyq [github.com/mcmathja/curlyq.test]
.\consumer_test.go:404:42: undefined: syscall.SIGUSR1
.\consumer_test.go:421:5: undefined: syscall.Kill
.\consumer_test.go:421:36: undefined: syscall.SIGUSR1
.\consumer_test.go:437:5: undefined: syscall.Kill
.\consumer_test.go:437:36: undefined: syscall.SIGUSR1
Thanks,
Gerasimos Maropoulos. Author of iris
Thanks for the feedback and the bug report @kataras!
The tests use syscall.SIGUSR1
in order to test shutdown behavior in response to a signal without unintentionally shutting down the test runner itself. Looking through the source now, it looks like SIGALRM
should be a valid cross-platform alternative.
Should be fixed - please let me know if there are still any issues getting the tests to run!
Hi @mcmathja, thanks for getting back.
Tests can run on windows now but they are "stuck", I was watching this screen for more than 5 minutes:
And when I press CTRL+C, I saw that one:
I believe that's the same set of tests, unfortunately.... Could you do me a favor and run the tests again with the Describe("Consume")
block on line 401 of consumer_test.go
switched to XDescribe
, to exclude those and verify it isn't hanging on any other tests? If so, I'll need to do a little more research to see if it's possible to achieve what this test is aiming to verify on Windows. It might be that the simplest option is to skip it in that environment.
Thanks again!