Hi All I'm seeing intermittent crashes in my unit test and wanted to check here first to see if anyone has suggestions before I filed an official issue.
Go version: go1.10.3 windows/amd64 GOPATH: C:\go GOROOT: C:\toolss\go OS: Windows 10 (10.0.17134) Pro Computer: Dell XPS 15 9560 with intel core i7 I have written a client/server application. Both client and server are on the same machine and communicate via gRPC over a named pipe. In the unit tests for the client side I spin up a stubbed server implementation and connect to it. The tests pass around 75% of the time, but the remaining 25% of the time they fail with runtime errors like this (I can't give the full stacktrace as the code is private): runtime: waitforsingleobject wait_failed; errno=6 fatal error: runtime.semasleep wait_failed runtime stack: runtime.throw(0x94ba8a, 0x1d) C:/tools/go/src/runtime/panic.go:616 +0x88 runtime.semasleep.func2() C:/tools/go/src/runtime/os_windows.go:579 +0x80 runtime.semasleep(0xffffffffffffffff, 0x0) C:/tools/go/src/runtime/os_windows.go:577 +0xe7 runtime.notesleep(0xc04225ed18) C:/tools/go/src/runtime/lock_sema.go:167 +0xf7 runtime.stopm() C:/tools/go/src/runtime/proc.go:1952 +0xf3 runtime.findrunnable(0xc04202c500, 0x0) C:/tools/go/src/runtime/proc.go:2415 +0x521 runtime.schedule() C:/tools/go/src/runtime/proc.go:2541 +0x149 runtime.goexit0(0xc042214f00) C:/tools/go/src/runtime/proc.go:2713 +0x244 runtime.mcall(0x0) C:/tools/go/src/runtime/asm_amd64.s:351 +0x5e goroutine 1 [chan receive]: testing.(*T).Run(0xc0423b62d0, 0x93fd1d, 0xb, 0x961438, 0x4932ad) C:/tools/go/src/testing/testing.go:825 +0x308 testing.runTests.func1(0xc0423b61e0) C:/tools/go/src/testing/testing.go:1063 +0x6b testing.tRunner(0xc0423b61e0, 0xc042091dd8) C:/tools/go/src/testing/testing.go:777 +0xd7 testing.runTests(0xc042178ee0, 0xc13f20, 0x9, 0x9, 0x0) C:/tools/go/src/testing/testing.go:1061 +0x2cb testing.(*M).Run(0xc04218c280, 0x0) C:/tools/go/src/testing/testing.go:978 +0x178 path/to/my/client.TestMain(0xc04218c280) C:/go/src/path/to/my/client/my_client_test.go:390 +0x4e main.main() _testmain.go:56 +0x158 .... <rest of stack trace> ..... And like this: runtime: setevent failed; errno=6 fatal error: runtime.semawakeup runtime stack: runtime.throw(0x944972, 0x12) C:/tools/go/src/runtime/panic.go:616 +0x88 runtime.semawakeup.func1() C:/tools/go/src/runtime/os_windows.go:597 +0x80 runtime.semawakeup(0xc042204800) C:/tools/go/src/runtime/os_windows.go:595 +0x53 runtime.notewakeup(0xc042204918) C:/tools/go/src/runtime/lock_sema.go:147 +0x60 runtime.startm(0x0, 0xc042028001) C:/tools/go/src/runtime/proc.go:2017 +0xe1 runtime.wakep() C:/tools/go/src/runtime/proc.go:2083 +0x4f runtime.resetspinning() C:/tools/go/src/runtime/proc.go:2454 +0x7f runtime.schedule() C:/tools/go/src/runtime/proc.go:2548 +0x133 runtime.goexit0(0xc042348000) C:/tools/go/src/runtime/proc.go:2713 +0x244 runtime.mcall(0x0) C:/tools/go/src/runtime/asm_amd64.s:351 +0x5e goroutine 1 [chan receive]: testing.(*T).Run(0xc04249a1e0, 0x93fd1d, 0xb, 0x961438, 0x4932ad) C:/tools/go/src/testing/testing.go:825 +0x308 testing.runTests.func1(0xc04249a0f0) C:/tools/go/src/testing/testing.go:1063 +0x6b testing.tRunner(0xc04249a0f0, 0xc042091dd8) C:/tools/go/src/testing/testing.go:777 +0xd7 testing.runTests(0xc042178ec0, 0xc13f20, 0x9, 0x9, 0x0) C:/tools/go/src/testing/testing.go:1061 +0x2cb testing.(*M).Run(0xc04218e280, 0x0) C:/tools/go/src/testing/testing.go:978 +0x178 path/to/my/client.TestMain(0xc04218e280) C:/go/src/path/to/my/client/my_client_test.go:390 +0x4e main.main() _testmain.go:56 +0x158 .... <rest of stack trace> ..... Errno 6 is Windows jargon for an invalid handle which is an expected error from WaitForSingleObject ( https://docs.microsoft.com/en-us/windows/desktop/api/synchapi/nf-synchapi-waitforsingleobject). Has anyone seen this before? Any help greatly appreciate, and let me know if I can provide more information. Cheers Toby -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.