Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Oauth failures in pkg/storage/chunk/gcp Test_Hedging #5832

Closed
bboreham opened this issue Apr 8, 2022 · 0 comments · Fixed by #5834
Closed

Oauth failures in pkg/storage/chunk/gcp Test_Hedging #5832

bboreham opened this issue Apr 8, 2022 · 0 comments · Fixed by #5834

Comments

@bboreham
Copy link
Contributor

bboreham commented Apr 8, 2022

Describe the bug
When I tried to run Loki unit tests locally I got errors like this:

--- FAIL: Test_Hedging (1.02s)
    --- FAIL: Test_Hedging/delete/put/list_are_not_hedged (0.38s)
        gcs_object_client_test.go:77: 
                Error Trace:    gcs_object_client_test.go:77
                Error:          Not equal: 
                                expected: 3
                                actual  : 0

Much single-stepping identified that the call was failing on an Oauth token fetch to http://oauth2.googleapis.com/.

Removing ~/.config/gcloud/application_default_credentials.json gave a simpler error:

--- FAIL: Test_Hedging (0.62s)
    --- FAIL: Test_Hedging/delete/put/list_are_not_hedged (0.22s)
        gcs_object_client_test.go:75: 
                Error Trace:    gcs_object_client_test.go:75
                Error:          Received unexpected error:
                                google: could not find default credentials. See https://developers.google.com/accounts/docs/application-default-credentials for more information.

I submit that this unit test should not be contacting Google for Oauth tokens.

To Reproduce

$ mv ~/.config/gcloud/application_default_credentials.json /tmp/
$ go test github.com/grafana/loki/pkg/storage/chunk/gcp

Expected behavior
Tests pass without contacting Google.

Environment:

Linux vagrant 5.4.0-72-generic #80-Ubuntu SMP Mon Apr 12 17:35:00 UTC 2021 x86_64 x86_64 x86_64 GNU/Linux
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant