Repository navigation
testdata: add a PGO regression test for the toolexec wrapper - #12
Merged
Merged
Conversation
toolexec_reproducible.txt checks that two separate builds of a rewritten package give the same archive, but not the failure that motivated #11: with PGO, go test compiles a package once for a main package's binary and again for its test binary, compiles the test against one copy and links the other, and the linker reports a fingerprint mismatch when the two differ. toolexec_pgo.txt reproduces that. A main package with a default.pgo has a test that imports the rewritten package, so the test binary gets a PGO copy of its own. The profile is written by a small program in the script, since a CPU profile with no samples is enough to turn PGO on. Without #11, go test ./... fails with the same link error seen in goav1. toolexec_reproducible.txt now checks the wrapper's log against a log.want section and that both builds print nothing, and limits the log to the package under test, like the other toolexec scripts.
mauri870
enabled auto-merge (squash)
November 3, 2026 20:52
mauri870
added a commit
that referenced
this pull request
Nov 3, 2026
In 2196e07 I added `test-qemu-arm64` without a `-timeout`, so the root package gets `go test`'s default of 10 minutes. On CI, the arm64 qemu step has taken anywhere from 237 to 438 seconds. The tip job of #12, which adds one more toolexec script, hit the limit: ``` panic: test timed out after 10m0s running tests: TestScripts/flag_precedence (2m3s) TestScripts/min_max_int (2m10s) ``` Nothing was stuck. The emulated suite is just slow, and runner speed varies. Locally under qemu, `toolexec_pgo` takes about as long as the other toolexec scripts, around 25 seconds of wall time with the scripts running in parallel. This change passes `-timeout=30m` to the target. `make test-qemu-arm64` passes locally with the change. After this merges, #12 needs a rerun, or a rebase onto master.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
toolexec_reproducible.txtchecks that two separate builds of a rewritten package give the same archive. It doesn't cover the failure that motivated #11. With PGO,go testcompiles a package once for a main package's binary and again for its test binary. It then compiles the test against one copy and links the other, and the linker reports a fingerprint mismatch when the two differ.toolexec_pgo.txtreproduces that. A main package with adefault.pgohas a test that imports the rewritten package, so the test binary gets a PGO copy of its own. The profile is written by a small program inside the script, because a CPU profile with no samples is enough to turn PGO on. Without #11,go test ./...fails with the same link error seen in goav1:toolexec_reproducible.txtis also brought in line with the other toolexec scripts:log.wantsection;LOOPVEC_TOOLEXEC_LOG_PKGS.Tested locally:
compile.goreverted, both scripts fail. The PGO one fails with the link error above, and the reproducible one atcmp a1.a a2.a.make testandmake test-qemu-arm64pass.-updateleaves both scripts unchanged.