grafana / loki

Like Prometheus, but for logs.
https://grafana.com/loki
GNU Affero General Public License v3.0
23.96k stars 3.46k forks source link

`TestTCPErrs` failing in Loki 3.2.0 release #14206

Closed daurnimator closed 1 month ago

daurnimator commented 2 months ago

Describe the bug TestTCPErrs failing in Loki 3.2.0 release

To Reproduce Steps to reproduce the behavior:

  1. run go test ./pkg/storage/chunk/client/gcp/

Expected behavior Tests pass

Environment: ArchLinux build system

Screenshots, Promtail config, or terminal output

--- FAIL: TestTCPErrs (0.11s)
    --- FAIL: TestTCPErrs/transport_connect_timeout_exceeded,_retryable (0.04s)
        gcs_object_client_test.go:233: 
                Error Trace:    /build/loki/src/loki-3.2.0/pkg/storage/chunk/client/gcp/gcs_object_client_test.go:233
                Error:          Not equal: 
                                expected: true
                                actual  : false
                Test:           TestTCPErrs/transport_connect_timeout_exceeded,_retryable
FAIL
FAIL    github.com/grafana/loki/v3/pkg/storage/chunk/client/gcp 1.250s

Adding a print for tc.name and the error I get:

request took longer than client timeout, not retryable Get "http://127.0.0.1:40385/test-bucket/foo": context deadline exceeded
client timeout exceeded on connect, not retryable Get "http://127.0.0.1:38809/test-bucket/foo": context deadline exceeded
transport connect timeout exceeded, retryable Get "http://127.0.0.1:39235/test-bucket/foo": context deadline exceeded (Client.Timeout exceeded while awaiting headers)
connection is closed server-side before being established Get "http://127.0.0.1:36567/test-bucket/foo": read tcp 127.0.0.1:47866->127.0.0.1:36567: read: connection reset by peer
connection is closed server-side after being established Get "http://127.0.0.1:40381/test-bucket/foo": read tcp 127.0.0.1:36634->127.0.0.1:40381: read: connection reset by p
paul1r commented 2 months ago

Are you running Go 1.23?

I am suspecting the underlying implementation for Go 1.23 changed the behavior for this specific test case.

paul1r commented 2 months ago


% /usr/local/go/bin/go test ./...
ok      github.com/grafana/loki/v3/pkg/storage/chunk/client/gcp 1.762s
% /usr/local/go/bin/go version   
go version go1.22.7 darwin/arm64

% go test ./...                  
--- FAIL: TestTCPErrs (0.11s)
    --- FAIL: TestTCPErrs/transport_connect_timeout_exceeded,_retryable (0.04s)
        gcs_object_client_test.go:233: 
                Error Trace:    /Users/progers/dev/src/github.com/grafana/loki/pkg/storage/chunk/client/gcp/gcs_object_client_test.go:233
                Error:          Not equal: 
                                expected: true
                                actual  : false
                Test:           TestTCPErrs/transport_connect_timeout_exceeded,_retryable
FAIL
FAIL    github.com/grafana/loki/v3/pkg/storage/chunk/client/gcp 1.754s
FAIL
% go version
go version go1.23.1 darwin/arm64
daurnimator commented 1 month ago

Are you running Go 1.23?

Yes

paul1r commented 1 month ago

I have put in a fix into the main branch, along with the 3.2 branch, so 3.2.1 will have this fix.