go-grpc-prometheus
go-grpc-prometheus copied to clipboard
Some test failed
trafficstars
go test shows errors sometimes, It's not always happen
there maybe errors like bellow
➜ go-grpc-prometheus git:(master) go test
--- FAIL: TestStreamingIncrementsHandled (0.00s)
Error Trace: server_test.go:218
Error: Not equal:
expected: 1
received: 0
Messages: grpc_server_handled_total should be incremented for PingList FailedPrecondition
--- FAIL: TestStreamingIncrementsStarted (0.00s)
Error Trace: server_test.go:168
Error: Not equal:
expected: 6
received: 5
Messages: grpc_server_started_total should be incremented for PingList
--- FAIL: TestServerInterceptorSuite (0.05s)
server_test.go:86: stopped grpc.Server at: 127.0.0.1:51448
FAIL
exit status 1
Yup - it seems flaky. I think because all these tests are based on time (e.g that test case have 1 minute to complete), and Travis being super slow at certain moments.
Any PR fixing that are welcome (:
FWIW: I'm working on some other fixes and also just noticed occasional test failures in TestServerInterceptorSuite on my local system (8-core, otherwise idle):
$ go test -run=TestServerInterceptorSuite
--- FAIL: TestServerInterceptorSuite (0.11s)
--- FAIL: TestServerInterceptorSuite/TestStreamingIncrementsHandled (0.01s)
server_test.go:218:
Error Trace: server_test.go:218
Error: Not equal:
expected: 1
actual : 0
Test: TestServerInterceptorSuite/TestStreamingIncrementsHandled
Messages: grpc_server_handled_total should be incremented for PingList FailedPrecondition
--- FAIL: TestServerInterceptorSuite/TestStreamingIncrementsStarted (0.00s)
server_test.go:168:
Error Trace: server_test.go:168
Error: Not equal:
expected: 6
actual : 5
Test: TestServerInterceptorSuite/TestStreamingIncrementsStarted
Messages: grpc_server_started_total should be incremented for PingList
server_test.go:86: stopped grpc.Server at: 127.0.0.1:50543
FAIL
exit status 1
FAIL github.com/grpc-ecosystem/go-grpc-prometheus 0.131s
$ go test -run=TestServerInterceptorSuite
--- FAIL: TestServerInterceptorSuite (0.11s)
--- FAIL: TestServerInterceptorSuite/TestStreamingIncrementsHistograms (0.01s)
server_test.go:193:
Error Trace: server_test.go:193
Error: Not equal:
expected: 4
actual : 3
Test: TestServerInterceptorSuite/TestStreamingIncrementsHistograms
Messages: grpc_server_handling_seconds_count should be incremented for PingList FailedPrecondition
server_test.go:86: stopped grpc.Server at: 127.0.0.1:50527
FAIL
exit status 1
FAIL github.com/grpc-ecosystem/go-grpc-prometheus 0.132s
$ go version
go version go1.10.1 darwin/amd64
$ git describe --tag
v1.1-39-g67e2f48