You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
test(archtest): the recursion pin's load can trip a go/types data race #855
loweringCallGraph (internal/archtest/recursion_test.go) type-checks the four lowering packages in one packages.Load call:
compilers/openapi
compilers/openapi/internal/auth
compilers/openapi/internal/operation
compilers/openapi/internal/schema
go/packages type-checks every package whose imports are done at the same time, one checker per package. auth and schema import neither each other nor the other two, so their checkers can run concurrently.
Go 1.27.2's go/types has a data race between concurrent checkers that share an imported package (golang/go#81122). Checker.isComplete reads Named.fromRHS with no lock, while another checker's Named.unpack writes it as it expands a generic instance from that package. The fix (golang/go#81871) is not in any release. Under -race, which make coverage and CI use, the race fails every test running in the binary at that moment.
#837's first version loaded ir and the whole compilers/openapi tree in one call this way. Its compilers/openapi tests failed 1 run in 15 under make coverage's flags, with Named.unpack against Checker.isComplete inside packages.(*loader).loadPackage. archtest's load has the same shape with fewer independent roots. 40 isolated runs of the recursion pin on main at a2530c3 did not trip it, so it is rare, not impossible.
Expected
No packages.Load call in the test suite type-checks two packages at once. Either would do:
Once #1311 lands, CI no longer runs internal/archtest under -race: it is not on scripts/race-packages.txt, because nothing in it runs morphic code concurrently, which is what the list's rule counts. So this go/types race can no longer fail the gate. The fix is still needed for anyone running archtest under -race locally.
Activity
test(decls): load each package alone to avoid a go/types data race
test(archtest): type-check the reachability program a package at a time
fuad-daoud commentedon Nov 2, 2026
Once #1311 lands, CI no longer runs
internal/archtestunder-race: it is not onscripts/race-packages.txt, because nothing in it runs morphic code concurrently, which is what the list's rule counts. So this go/types race can no longer fail the gate. The fix is still needed for anyone running archtest under-racelocally.