In general, the gRPC tests (in a pristine v0.23.0 checkout) seem to be utterly broken.

What's more, isolating the tests to just the GRPC tests fails in a completely different way:

$ go test ./...
ok      github.com/prometheus/blackbox_exporter (cached)
ok      github.com/prometheus/blackbox_exporter/config  (cached)
--- FAIL: TestGRPCConnection (0.00s)
    grpc_test.go:73: GRPC probe failed
panic: Fail in goroutine after TestGRPCConnection has completed

goroutine 612 [running]:
testing.(*common).Fail(0xc00023ad00)
        /usr/lib/go-1.19/src/testing/testing.go:824 +0xe5
testing.(*common).Errorf(0xc00023ad00, {0xc68a18?, 0xc000314390?}, {0xc00030dfc0?, 0x0?, 0xc000394ea0?})
        /usr/lib/go-1.19/src/testing/testing.go:941 +0x65
github.com/prometheus/blackbox_exporter/prober.TestGRPCConnection.func1()
        /tmp/blackbox_exporter/prober/grpc_test.go:56 +0x6e
created by github.com/prometheus/blackbox_exporter/prober.TestGRPCConnection
        /tmp/blackbox_exporter/prober/grpc_test.go:54 +0x325
FAIL    github.com/prometheus/blackbox_exporter/prober  0.013s
FAIL

vs.

$ go test -run TestGRPC ./...
ok      github.com/prometheus/blackbox_exporter (cached) [no tests to run]
ok      github.com/prometheus/blackbox_exporter/config  (cached) [no tests to run]
--- FAIL: TestGRPCConnection (0.00s)
    grpc_test.go:73: GRPC probe failed
--- FAIL: TestGRPCTLSConnection (0.05s)
    grpc_test.go:237: GRPC probe failed
--- FAIL: TestGRPCServiceNotFound (0.00s)
    utils_test.go:48: Expected: probe_grpc_status_code: 5, got: probe_grpc_status_code: 0
--- FAIL: TestGRPCHealthCheckUnimplemented (0.00s)
    utils_test.go:48: Expected: probe_grpc_status_code: 12, got: probe_grpc_status_code: 0
FAIL
FAIL    github.com/prometheus/blackbox_exporter/prober  0.058s
FAIL

Attachment: OpenPGP_signature
Description: OpenPGP digital signature

Reply via email to