Skip to content

x/tools/cmd/gonew test failure "unexpected file out/upload.token" #66111

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

Closed
gopherbot opened this issue Mar 5, 2024 · 5 comments
Closed

x/tools/cmd/gonew test failure "unexpected file out/upload.token" #66111

gopherbot opened this issue Mar 5, 2024 · 5 comments
Assignees
Labels
FrozenDueToAge gopls Issues related to the Go language server, gopls. NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one. Tools This label describes issues relating to any tools in the x/tools repository.
Milestone

Comments

@gopherbot
Copy link
Contributor

#!watchflakes
default <- pkg == "golang.org/x/tools/gopls/internal/cmd" && test == "Test"

Issue created automatically to collect these failures.

Example (log):

--- FAIL: Test (0.67s)
    --- FAIL: Test/quote.txt (0.67s)
        main_test.go:138: unexpected file out/upload.token:

watchflakes

@gopherbot gopherbot added the NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one. label Mar 5, 2024
@gopherbot
Copy link
Contributor Author

Found new dashboard test flakes for:

#!watchflakes
default <- pkg == "golang.org/x/tools/gopls/internal/cmd" && test == "Test"
2024-03-04 22:41 netbsd-arm-bsiegert tools@7656c4c6 go@5dcc04ae x/tools/gopls/internal/cmd.Test (log)
--- FAIL: Test (0.67s)
    --- FAIL: Test/quote.txt (0.67s)
        main_test.go:138: unexpected file out/upload.token:

watchflakes

@gopherbot gopherbot added Tools This label describes issues relating to any tools in the x/tools repository. gopls Issues related to the Go language server, gopls. labels Mar 5, 2024
@gopherbot gopherbot added this to the Unreleased milestone Mar 5, 2024
@adonovan
Copy link
Member

adonovan commented Mar 5, 2024

The first test failure here is related to the new upload.token file created by x/telemetry. Assigning to @matloob to investigate.

@adonovan adonovan changed the title x/tools/gopls/internal/cmd: Test failures x/tools/gopls/internal/cmd: gonew test failure "unexpected file out/upload.token" Mar 5, 2024
@adonovan adonovan changed the title x/tools/gopls/internal/cmd: gonew test failure "unexpected file out/upload.token" x/tools/cmd/gonew test failure "unexpected file out/upload.token" Mar 5, 2024
@adonovan
Copy link
Member

adonovan commented Mar 5, 2024

The second failure (in x/tools/gopls/internal/cmd) appears to have a similar cause.

@matloob
Copy link
Contributor

matloob commented Mar 5, 2024

These tests are seeing the upload.token file in places where they don't expect it. This seems to be happening because HOME and XDG_CONFIG_HOME aren't set [on a unix platform], so telemetry.LocalDir isn't set, but we're still creating the upload.token file at filepath.Join(telemetry.LocalDir, "upload.token"). We should explicitly check for the case where telemetry.LocalDir isn't set and skip uploading completely in that case. (there are no counters to upload anyways in that case).

@gopherbot
Copy link
Contributor Author

Change https://go.dev/cl/569217 mentions this issue: telemetry: in Start skip uploading in certain cases

@golang golang locked and limited conversation to collaborators Mar 6, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
FrozenDueToAge gopls Issues related to the Go language server, gopls. NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one. Tools This label describes issues relating to any tools in the x/tools repository.
Projects
Archived in project
Development

No branches or pull requests

3 participants