Skip to content

test/goroot: match malformed selector recovery - #2227

Open
cpunion wants to merge 7 commits into
xgo-dev:mainfrom
cpunion:codex/xfail-audit-next-20260730
Open

test/goroot: match malformed selector recovery#2227
cpunion wants to merge 7 commits into
xgo-dev:mainfrom
cpunion:codex/xfail-audit-next-20260730

Conversation

@cpunion

@cpunion cpunion commented Jul 30, 2026

Copy link
Copy Markdown
Collaborator

Depends on #2222.

Summary

  • match the exact primary diagnostic and exact g(f..3) source shape from syntax/ddd.go
  • consume its three deterministic same-line follow-on diagnostics as independent one-use groups
  • remove only the syntax/ddd.go xfail

The regression coverage was added before the allowance and reproduced the failure. It includes wrong-source, missing-primary, and wrong-line counterexamples; shared tests already cover exact message multiplicity and //line fail-open behavior.

Validation

  • go test ./test/goroot -count=1
  • syntax/ddd.go with an empty xfail set on Go 1.24.11, 1.25.0, 1.26.0, and 1.26.5
  • all remaining 143 Go 1.26 compile/errorcheck xfails on Go 1.26.5
  • git diff --check

No cross-line recovery allowance is introduced.

@fennoai fennoai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review summary

Reviewed the authored changes in test/goroot/runner_test.go, test/goroot/runner_unit_test.go, and test/goroot/xfail.yaml (the libslirp0 CI change and merge commit in the range are pre-existing, not part of this PR's work).

This is a well-scoped test-infra change. The parser-recovery pairing is deliberately narrow — it keys on exact primary message, exact source shape (parserRecoverySourceCode), file, and line, with one-shot consumption — so every GOROOT ERROR stays mandatory and unrelated diagnostics can't be silently suppressed. The diagnosticPathResolver.resolve change actually tightens the previous behavior: an absolute path now has to identify a configured source before it resolves, closing a small over-permissive fallback. The physical/hasLineDirective gate correctly falls back to leaving all recovery diagnostics visible when a //line//*line*/ directive makes physical-line pairing ambiguous. The six removed xfail.yaml entries line up with the deterministic secondaries now handled by the pairing table.

Verification performed:

  • go vet ./test/goroot — clean.
  • Ran the new/pure unit tests (TestParseDirective*, TestDiscoverCases*, TestRunProgramTimeout, TestRunGeneratedProgramUsesProvidedTimeout, TestValidateSystemMemoryState, TestShardCases, etc.) — all pass.

One minor, non-blocking observation is left inline. No correctness, security, or performance concerns found.

Comment thread test/goroot/runner_test.go
@codecov

codecov Bot commented Jul 30, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@cpunion
cpunion force-pushed the codex/xfail-audit-next-20260730 branch from 3ba8bda to 417af27 Compare July 30, 2026 04:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant