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 upload.test@devel-devel-linux-amd64-2024-09-05.v1.count
    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

Comment From: gabyhelp

Related Issues and Documentation

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

Comment From: findleyr

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

Comment From: findleyr

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).

Comment From: gopherbot

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