hashicorp / go-metrics

A Golang library for exporting performance and runtime metrics to external metrics systems (i.e. statsite, statsd)
MIT License
1.46k stars 177 forks source link

tests are broken: statsd_test.go:78: bad line gauge.val:1.000000|g #157

Open stapelberg opened 1 year ago

stapelberg commented 1 year ago

In a fresh clone of the go-metrics repository, tests fail:

% go version
go version go1.20.2 linux/amd64

% git clone https://github.com/hashicorp/go-metrics
Cloning into 'go-metrics'...
remote: Enumerating objects: 791, done.
remote: Counting objects: 100% (222/222), done.
remote: Compressing objects: 100% (132/132), done.
remote: Total 791 (delta 113), reused 176 (delta 87), pack-reused 569
Receiving objects: 100% (791/791), 254.92 KiB | 7.97 MiB/s, done.
Resolving deltas: 100% (414/414), done.

% cd go-metrics 

% go test ./...
go: downloading github.com/DataDog/datadog-go v3.2.0+incompatible
go: downloading github.com/circonus-labs/circonus-gometrics v2.3.1+incompatible
go: downloading github.com/circonus-labs/circonusllhist v0.1.3
go: downloading github.com/hashicorp/go-retryablehttp v0.5.3
go: downloading github.com/tv42/httpunix v0.0.0-20150427012821-b75d8614f926
go: downloading github.com/hashicorp/go-cleanhttp v0.5.0
--- FAIL: TestDisplayMetrics (0.00s)
    inmem_endpoint_test.go:34: bad: [0xc0000942a0 0xc000094360]
--- FAIL: TestStatsd_Conn (3.00s)
    statsd_test.go:78: bad line gauge.val:1.000000|g
    statsd_test.go:134: timeout
2023/06/19 14:12:38 [ERR] Error connecting to statsd! Err: dial udp: address statsd.service.consul: missing port in address
2023/06/19 14:12:38 [ERR] Error connecting to statsd! Err: dial udp: lookup statsd.service.consul: no such host
2023/06/19 14:12:38 [ERR] Error connecting to statsite! Err: dial tcp: lookup someserver: no such host
2023/06/19 14:12:38 [ERR] Error connecting to statsd! Err: dial udp: lookup someserver: no such host
--- FAIL: TestStatsite_Conn (3.00s)
    statsite_test.go:74: bad line gauge.val:1.000000|g
    statsite_test.go:131: timeout
FAIL
FAIL    github.com/hashicorp/go-metrics 26.450s
ok      github.com/hashicorp/go-metrics/circonus    0.004s
ok      github.com/hashicorp/go-metrics/datadog 1.248s
ok      github.com/hashicorp/go-metrics/prometheus  2.010s
FAIL
go test ./...  5,40s user 1,50s system 25% cpu 27,238 total

I also noticed that there is a CircleCI setup, but I don’t see any CI reports in pull requests.

Maybe it would be good to set up GitHub Actions instead? Or integrate CircleCI better somehow?

Thanks