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

x/telemetry: golang.org/x/telemetry/internal/upload.TestRun_Basic failing at tip #69454

Closed
timothy-king opened this issue Sep 13, 2024 · 4 comments
Assignees
Labels
FixPending Issues that have a fix which has not yet been reviewed or submitted. NeedsFix The path to resolution is known, but the work has not been done. telemetry x/telemetry issues
Milestone

Comments

@timothy-king
Copy link
Contributor

TestRun_Basic is failing consistently at tip.

Output:

=== RUN   TestRun_Basic
    run_test.go:68: 18:00:53.772200 findwork.go:35: Finding work: mode on asof 2023-09-14 00:00:00 +0000 UTC
    run_test.go:68: 18:00:53.772345 findwork.go:50: Collecting count file [email protected]
    run_test.go:68: 18:00:53.772454 reports.go:34: Last week: , today: 2024-09-13
    run_test.go:68: 18:00:53.772713 reports.go:268: Created 2024-09-11.json, deleting 1 count files
    run_test.go:68: 18:00:53.772775 reports.go:68: Ready to upload: 2024-09-11.json
    run_test.go:68: 18:00:53.772793 run.go:172: Uploading 1 reports
    run_test.go:68: 18:00:53.773506 upload.go:115: Uploaded 2024-09-11.json to "http://127.0.0.1:39175/2024-09-11"
    run_test.go:153: Mismatching uploaded report:
        got:
        {
        	"Week": "2024-09-11",
        	"LastWeek": "",
        	"X": 0.7813658081300514,
        	"Programs": [
        		{
        			"Program": "golang.org/x/telemetry/internal/upload.test",
        			"Version": "devel",
        			"GoVersion": "devel",
        			"GOOS": "linux",
        			"GOARCH": "amd64",
        			"Counters": {
        				"knownCounter": 1
        			},
        			"Stacks": {}
        		}
        	],
        	"Config": "v1.2.3"
        }
        want:
        {
        	"Week": "2024-09-11",
        	"LastWeek": "",
        	"X": 0.7813658081300514,
        	"Programs": [
        		{
        			"Program": "upload.test",
        			"Version": "",
        			"GoVersion": "devel",
        			"GOOS": "linux",
        			"GOARCH": "amd64",
        			"Counters": {
        				"knownCounter": 1
        			},
        			"Stacks": {}
        		}
        	],
        	"Config": "v1.2.3"
        }
--- FAIL: TestRun_Basic (0.02s)

Note that Version and and Program differ.

Reproduces locally.

CC @findleyr

@timothy-king timothy-king added NeedsFix The path to resolution is known, but the work has not been done. telemetry x/telemetry issues labels Sep 13, 2024
@timothy-king timothy-king added this to the Backlog milestone Sep 13, 2024
@gabyhelp
Copy link

Related Issues and Documentation

(Emoji vote if this was helpful or unhelpful; more detailed feedback welcome in this discussion.)

@findleyr
Copy link
Member

This failure relates to build info, which correlates with the change in the main repo where the failure started: https://go.dev/cl/613096.

CC @matloob @samthanawalla

@findleyr
Copy link
Member

findleyr commented Sep 13, 2024

Aha, looks like this is working as intended: https://go.googlesource.com/telemetry/+/c4c42c540963e6e281f4d6d13532e88c29203f65/internal/telemetry/proginfo.go#36

(copying snippet since I don't know how to permalink):

func ProgramInfo(info *debug.BuildInfo) (goVers, progPath, progVers string) {
	goVers = info.GoVersion
	// TODO(matloob): Use go/version.IsValid instead of checking for X: once the telemetry
	// module can be upgraded to require Go 1.22.
	if strings.Contains(goVers, "devel") || strings.Contains(goVers, "-") || strings.Contains(goVers, "X:") {
		goVers = "devel"
	}
	progPath = info.Path
	if progPath == "" {
		progPath = strings.TrimSuffix(filepath.Base(os.Args[0]), ".exe")
	}

We need to update the test now that the test binary has a proper program path. (EDIT: on it).

@findleyr findleyr self-assigned this Sep 13, 2024
@gopherbot
Copy link
Contributor

Change https://go.dev/cl/613275 mentions this issue: internal/upload: update test assertions to account for test build info

@dmitshur dmitshur added the FixPending Issues that have a fix which has not yet been reviewed or submitted. label Sep 14, 2024
@dmitshur dmitshur modified the milestones: Backlog, Unreleased Sep 14, 2024
Pinkle-pash added a commit to Pinkle-pash/telemetry that referenced this issue Dec 4, 2024
Now that test build info is populated (golang/go#33976), we need to
update assertions for tests that collect counter information from the
test binary.

Fixes golang/go#69454

Change-Id: I6c7a7ee0ccd588de3d166bc903417a89fd4a0eae
Reviewed-on: https://go-review.googlesource.com/c/telemetry/+/613275
Reviewed-by: Hongxiang Jiang <[email protected]>
Auto-Submit: Robert Findley <[email protected]>
Reviewed-by: Tim King <[email protected]>
LUCI-TryBot-Result: Go LUCI <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
FixPending Issues that have a fix which has not yet been reviewed or submitted. NeedsFix The path to resolution is known, but the work has not been done. telemetry x/telemetry issues
Projects
None yet
Development

No branches or pull requests

5 participants