Repository navigation
test: fix local test failures and require race runs only for touched packages - #1192
Merged
Merged
Conversation
zzet
approved these changes
Oct 31, 2026
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.
Summary
Fixes three test failures that show up locally and never in CI, and proposes dropping the "full
go test -race ./...before every PR" requirement from the template and contributor docs, since it is rarely followed in practice.Relates to #1114, #879.
Changes
bsearch.h:72:7: error: expected identifier or '(' before '_Generic'). With glibc 2.43+ and a compiler defaulting to C23 (gcc 15+), glibc definesbsearchas a_Genericmacro, which breaks thebsearchthe Perl grammar defines ingo-sitter-forest/perlv1.9.9. Upstream tree-sitter-perl fixed it in fix: improve error recovery for strings and incomplete calls tree-sitter-perl/tree-sitter-perl#220, but go-sitter-forest has not regeneratedperlyet, so there is no version to bump to. OnlyTestDumpGrammarKinds, a manual research helper, imports that grammar, so it now builds only with-tags grammardump. Regulargo test ./...no longer fails on newer distros. This is the local counterpart of Pin Linux CI to Ubuntu 24.04 while the Perl C23 fix is unpublished #1114, which pinned CI to Ubuntu 24.04; that pin can probably go once this lands.internal/releaseswith tag signing enabled.setupTaggedReposetstag.gpgsign falsein its temp repo, so a globaltag.gpgsign=trueno longer turnsgit tag v0.1into a signed tag that fails with "no tag message?".TestCheckedBatchContextRollsBackEarlierChunksAndBuiltinAdmission/1. The checkpoint wait helpers allowed 2 s, which is too short for a 4096-row chunk when SQLite itself is race-instrumented (failed every run under plaingo test -race). The budget is now 30 s; it only bounds a broken fixture, so passing runs take no longer.make testuses CI's race flags (modernc SQLite and libc excluded from instrumentation) and acceptsPKGSto narrow the run:make test PKGS=./internal/<pkg>/....CONTRIBUTING.md,README.mdandCLAUDE.mdask for the touched packages undermake test PKGS=...and state that CI runs the full suite.Proposal: drop the full race run requirement
The template asks for
go test -race ./...before every PR. Locally that takes well over an hour:store_sqlite,indexerandmcprun their tests serially in one process, and plain-racealso instruments the transpiled SQLite. CI finishes becausescripts/ci-testspreads each package over one worker per CPU and splitsindexeracross two jobs.In practice nobody runs it. Across the last 200 PRs (#791 to #1191):
-race), 5 give no evidence, and 1 (fix(hooks): answer inline Python that reads indexed source #1185) claims a full local run.internal/indexerran past the 60 minutes"), fix(mcp): read overlay cohort for pr_review_context simulation session #1134, feat(llm): add Runcrate gateway preset #1178.Writing down what is actually done keeps the checkbox meaningful, and the full suite still runs on every PR in CI.
Testing
make test PKGS=./internal/<pkg>/...); CI runs the full suiteRan
go test -raceoninternal/parser/forest(with the flags from the docs, no-std=gnu17),internal/releases(with globaltag.gpgsign=true), and the checkpoint and checked batch tests ininternal/graph/store_sqlite(3/3 under plain-race, previously failing every run).go test -tags grammardump -run TestDumpGrammarKinds ./internal/parser/forest/still needs-std=gnu17inCGO_CFLAGSon glibc 2.43+.scripts/check-cgo-flags.shpasses, andmake -n test/make -n test PKGS=...expand as expected.Checklist
Meta["methods"]for interfaces (if applicable)EdgeMemberOfedges to their containing type (if applicable)